tahamajs's picture
download
raw
577 Bytes
/**
* @param {number} code_unit
* @param {boolean} utf16be
* @return {!Array.<number>} bytes
*/
export function convertCodeUnitToBytes(code_unit, utf16be) {
// 1. Let byte1 be code unit >> 8.
var byte1 = code_unit >> 8;
// 2. Let byte2 be code unit & 0x00FF.
var byte2 = code_unit & 0x00FF;
// 3. Then return the bytes in order:
// utf-16be flag is set: byte1, then byte2.
if (utf16be)
return [byte1, byte2];
// utf-16be flag is unset: byte2, then byte1.
return [byte2, byte1];
}
//# sourceMappingURL=converCodeUnitToBytes.js.map

Xet Storage Details

Size:
577 Bytes
·
Xet hash:
c105a6a36596bfc09369d59fcade608eecfa0d3c3398d112c68527ee6b74f51d

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.