Skip to content

Commit 1fdb6e2

Browse files
authored
Update packages/utils/src/bytes.ts
1 parent fa25623 commit 1fdb6e2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/utils/src/bytes.ts

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export function toHex(buffer: Uint8Array | Parameters<typeof Buffer.from>[0]): s
5959
// Shared buffer to convert root to hex
6060
const rootBuf = Buffer.alloc(32);
6161

62+
/**
63+
* Convert a Uint8Array, length 32, to 0x-prefixed hex string
64+
*/
6265
export function toRootHex(root: Uint8Array): string {
6366
rootBuf.set(root);
6467
return `0x${rootBuf.toString("hex")}`;

0 commit comments

Comments
 (0)