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

Function dataLength

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

Source from the content-addressed store, hash-verified

121 * Returns the length of %%data%%, in bytes.
122 */
123export function dataLength(data: BytesLike): number {
124 if (isHexString(data, true)) { return (data.length - 2) / 2; }
125 return getBytes(data).length;
126}
127
128/**
129 * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%

Callers

nothing calls this directly

Calls 2

isHexStringFunction · 0.70
getBytesFunction · 0.70

Tested by

no test coverage detected