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

Function hexlify

src.ts/utils/data.ts:101–110  ·  view source on GitHub ↗
(data: BytesLike)

Source from the content-addressed store, hash-verified

99 * Returns a [[DataHexString]] representation of %%data%%.
100 */
101export function hexlify(data: BytesLike): string {
102 const bytes = getBytes(data);
103
104 let result = "0x";
105 for (let i = 0; i < bytes.length; i++) {
106 const v = bytes[i];
107 result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];
108 }
109 return result;
110}
111
112/**
113 * 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