MCPcopy Create free account
hub / github.com/dfinity/nns-dapp / bytesToHexString

Function bytesToHexString

frontend/src/lib/utils/utils.ts:104–108  ·  view source on GitHub ↗
(bytes: number[])

Source from the content-addressed store, hash-verified

102
103// Convert a byte array to a hex string
104export const bytesToHexString = (bytes: number[]): string =>
105 bytes.reduce(
106 (str, byte) => `${str}${byte.toString(16).padStart(2, "0")}`,
107 ""
108 );
109
110// Convert a hex string to a byte array
111// Source: https://stackoverflow.com/a/34356351

Callers 5

subaccountToHexStringFunction · 0.90
utils.spec.tsFile · 0.90
stringifyJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected