export const stringToBytes = (str) => {
    return Uint8Array.from(str, (x) => x.charCodeAt(0));
};
export const bytesToString = (bytes) => {
    const arr = [];
    bytes.forEach((n) => arr.push(n));
    return String.fromCharCode.apply(String, arr);
};
export const bytesToHexString = (bytes) => {
    return bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');
};
export const hexStringToBytes = (hexString) => {
    var _a;
    return new Uint8Array(((_a = hexString.match(/.{1,2}/g)) !== null && _a !== void 0 ? _a : []).map((byte) => parseInt(byte, 16)));
};
export const toCaps = (value = '', separator = ' ', split = '-') => {
    return value
        .split(split)
        .map((v) => v.charAt(0).toUpperCase() + v.substring(1))
        .reduce((a, b) => `${a}${separator}${b}`);
};
//# sourceMappingURL=helpers.js.map