MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / byteArrayToHex

Function byteArrayToHex

app/util/bytes.js:8–16  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

6 * @returns - Hex string
7 */
8export default function byteArrayToHex(value) {
9 const HexCharacters = '0123456789abcdef';
10 const result = [];
11 for (let i = 0; i < value.length; i++) {
12 const v = value[i];
13 result.push(HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]);
14 }
15 return '0x' + result.join('');
16}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected