MCPcopy Create free account
hub / github.com/Snapchat/Valdi / encodeUtf32LE

Function encodeUtf32LE

src/valdi_modules/src/valdi/coreutils/web/UnicodeNative.ts:192–200  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

190 const b0 = bytes[0],
191 b1 = bytes[1];
192 if (b0 === 0xfe && b1 === 0xff) {
193 be = true;
194 offset = 2;
195 } else if (b0 === 0xff && b1 === 0xfe) {
196 be = false;
197 offset = 2;
198 }
199 }
200 const dv = new DataView(bytes.buffer, bytes.byteOffset + offset, bytes.byteLength - offset);
201 const len = dv.byteLength & ~1;
202 const codeUnits: number[] = new Array(len / 2);
203 for (let i = 0; i < len; i += 2) {

Callers 1

encodeStringFunction · 0.85

Calls 1

toCodePointsFunction · 0.85

Tested by

no test coverage detected