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

Function stripZerosLeft

lib.commonjs/utils/data.js:131–137  ·  view source on GitHub ↗

* Return the [[DataHexString]] result by stripping all **leading** ** zero bytes from %%data%%.

(data)

Source from the content-addressed store, hash-verified

129 ** zero bytes from %%data%%.
130 */
131function stripZerosLeft(data) {
132 let bytes = hexlify(data).substring(2);
133 while (bytes.startsWith("00")) {
134 bytes = bytes.substring(2);
135 }
136 return "0x" + bytes;
137}
138exports.stripZerosLeft = stripZerosLeft;
139function zeroPad(data, length, left) {
140 const bytes = getBytes(data);

Callers

nothing calls this directly

Calls 1

hexlifyFunction · 0.70

Tested by

no test coverage detected