9 lines
228 B
TypeScript
Raw Normal View History

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');
}