forked from olcxjas-softworks/LarpixClient
update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
20
electron/node_modules/@peculiar/utils/build/esm/encoding/binary.js
generated
vendored
Normal file
20
electron/node_modules/@peculiar/utils/build/esm/encoding/binary.js
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { toUint8Array } from "../bytes/index.js";
|
||||
export function encode(data) {
|
||||
const bytes = toUint8Array(data);
|
||||
let result = "";
|
||||
for (const byte of bytes) {
|
||||
result += String.fromCharCode(byte);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function decode(text) {
|
||||
const result = new Uint8Array(text.length);
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
result[i] = text.charCodeAt(i) & 0xff;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function is(text) {
|
||||
return typeof text === "string";
|
||||
}
|
||||
export const binary = { encode, decode, is };
|
||||
Loading…
Add table
Add a link
Reference in a new issue