Encode returning false
ajmas opened this issue · comments
Andre-John Mas commented
I am running into an issue where base85.encode() is returning false. This is happening bother with a buffer and a text string. I am using Node 8.9.4.
For the text case:
base85.encode('hello world')
For the buffer it is one created by crypto.cipher
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(algorithm, key, iv);
let encrypted = cipher.update(value, 'utf8');
encrypted = Buffer.concat([encrypted, cipher.final()]);
console.log(base85.encode(iv) + ',' + base85.encode(encrypted));
Here iv
works fine, but not the encrypted
buffer.
Note that 'ascii85' seems to work ok, but not 'z85'.
Andre-John Mas commented
Rereading the docs I now see this is a limitation of the z85 specification, though I am wondering whether throwing an exception would not be better, than returning false?
sigdavis commented
This is super old, but I am experiencing this as well, and take it it hasn't been addressed - or a work around?