2021-07-02 13:52:10 +10:00

9 lines
228 B
TypeScript

export function byteArrayToHex(bytes: Uint8Array): string {
const buf = new Buffer(bytes);
return buf.toString('hex');
}
export function hexToBuf(str: string): Buffer {
return Buffer.from(str.replace(/0x/, ''), 'hex');
}