yEnc is a binary-to-text encoding scheme for transferring binary files in messages... yEnc's overhead is often (if each byte value appears approximately with the same frequency on average) as little as 1–2%,1 compared to 33–40% overhead for 6-bit encoding methods like uuencode and Base64.
https://en.wikipedia.org/wiki/YEnc
I use this lib for yEnc encode https://www.npmjs.com/package/simple-yenc
What I am doing wrong.
This browser test encode image to string
/** @param {Blob} img */
const test = img => {
// yEnc
img.arrayBuffer()
.then(arrayBuffer => console.log(dynamicEncode(new Uint8Array(arrayBuffer))));
// base64
const reader = new FileReader();
reader.onloadend = () => console.log(reader.result);
reader.readAsDataURL(img);
};
yEnc string is 5.5 MB
base64 string is 4.7 MB
My goal is to store image in JSON.
