MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / hexlify

Function hexlify

lib.commonjs/utils/data.js:83–91  ·  view source on GitHub ↗

* Returns a [[DataHexString]] representation of %%data%%.

(data)

Source from the content-addressed store, hash-verified

81 * Returns a [[DataHexString]] representation of %%data%%.
82 */
83function hexlify(data) {
84 const bytes = getBytes(data);
85 let result = "0x";
86 for (let i = 0; i < bytes.length; i++) {
87 const v = bytes[i];
88 result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];
89 }
90 return result;
91}
92exports.hexlify = hexlify;
93/**
94 * Returns a [[DataHexString]] by concatenating all values

Callers 4

concatFunction · 0.70
dataSliceFunction · 0.70
stripZerosLeftFunction · 0.70
zeroPadFunction · 0.70

Calls 1

getBytesFunction · 0.70

Tested by

no test coverage detected