function toControlChars(input: string): string
const output = toControlChars("Hello World!");
console.log(output);
output >> "\x02\b\x03\x05\x03\f\x03\f\x03\x0F\x01\x00\x02\x17\x03\x0F\x03\x12\x03\f\x03\x04\x01\x01"
function fromControlChars(input: string): string
const output = fromControlChars("\x02\b\x03\x05\x03\f\x03\f\x03\x0F\x01\x00\x02\x17\x03\x0F\x03\x12\x03\f\x03\x04\x01\x01");
console.log(output);
output >> "Hello World!"
async function encode(text: string, password: string): Promise<Uint8Array>
function baseEncode(bytes: Uint8Array): string
const bytes = await encode("Hello World!", "123");
const output = baseEncode(bytes);
console.log(output);
output >> "$E#>!g#2$_!b#[$C!g!w#~#*#u!%#F#|!A$4#_#k!p$ ..." // obfuscated string
async function decode(bytes: Uint8Array, password: string): Promise<string>
function baseDecode(str: string): Uint8Array<ArrayBuffer>
const bytes = await baseDecode("$E#>!g#2$_!b#[$C!g!w#~#*#u!%#F#|!A$4#_#k!p$ ..." /* obfuscated string */);
const output = decode(bytes, "123");
console.log(output);
output >> "Hello World!"
function saveBinaryFile(bytes: Uint8Array<ArrayBufferLike>, filename?: string): void
const bytes = new Uint8Array([0x00, 0x03, 0x05]);
saveBinaryFile(bytes, "bytes.bin"); // binary file downloaded.
function readBinaryFile(file: File): Promise<Uint8Array<ArrayBufferLike>>
const fileInput = document.getElementById("fileInput"); // file input tag id
fileInput.onchange = async () => {
if (!fileInput.files || fileInput.files.length === 0) return;
const file = fileInput.files[0];
try {
const bytes = await upack.readBinaryFile(file);
console.log(bytes);
}
}
output >> [0, 3, 5];
function encodeSEncode(buffer: ArrayBuffer, secretKey: string): Promise<string>
const output = await encodeSEncode(new Uint8Array([0x06, 0x09, 0x21]), "SAMPLE");
console.log(output);
output >> "本原瑛里子TochiraYamamura西岡そうたSoutaFujii"
function decodeSEncode(text: string, secretKey: string): Promise<ArrayBuffer>
const output = new Uint8Array(await decodeSEncode("本原瑛里子TochiraYamamura西岡そうたSoutaFujii", "SAMPLE"));
console.log(output);
output >> [6, 9, 33];
function randomGenerate(length: number, prefix?: string, prefix2?: string): Promise<string>
const output = await randomGenerate(3, "_");
console.log(output);
output >> "入江紗菜_横田彩芽_辻葵衣" // これは一例です 実際はランダムな文字列が出力されます。