3 ms·
Sorry, it doesn't work on binary data: node> var buf = require('fs').readFileSync('./tests/data/data-png.png'); node> require('jacob.js').base64.encode
by pkrumins 16y ago
Sorry, it doesn't work on binary data:
node> var buf = require('fs').readFileSync('./tests/data/data-png.png');
node> require('jacob.js').base64.encode(buf)
Base64CodecError: Input contains out-of-range characters.
Also node.js now has its own base64 encoding and decoding functions right in Buffer, so there is no longer need for any base64 modules.
- jacobolus 16y agoWell okay, it's intended to work in the browser (note: this was also written before Node had any decent binary data type; I haven't really been keeping track, does it now?) and so "binary data" is just a string where each byte is the lower byte of one character. It could pretty easily be modified to take advantage of better data types in contexts where they are available (or if someone's using a string for "binary data" where two bytes of data are stored in each character, modified to deal with that).
- pkrumins 16y agoNo, it still does not!