byteworder.js
v0.0.4
Published
Encode and Decode Bytes to Meaningful Word
Downloads
2
Readme
ByteWorder.js
Encode and Decode Bytes to Meaningful Word
Encode
const encoded = encodeUint8ArrayToWord(
new Uint8Array([2, 23, 43, 123, 2, 23, 42, 12, 34, 10, 98, 7])
);
console.log(encoded); // عاقبت مهر نر خدایی جهانبان تونیک تبرک
Decode
const encoded = "عاقبت مهر نر خدایی جهانبان تونیک تبرک";
const decoded = decodeWordToUint8Array(encoded);
console.log(decoded); // [2, 23, 43, 123, 2, 23, 42, 12, 34, 10, 98, 7]