mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-02-06 15:03:11 +00:00
9 lines
228 B
TypeScript
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');
|
||
|
|
}
|