dankogai / js-base64

Base64 implementation for JavaScript
BSD 3-Clause "New" or "Revised" License
4.27k stars 1.33k forks source link

Issue while encoding decoded strings with ~ character #141

Closed aravi365 closed 3 years ago

aravi365 commented 3 years ago

If we encode dwfedhgwefdf~12gehgdhegd and then decode it, then what i am getting is'dwfedhgwefdf�12gehgdhegd'

dankogai commented 3 years ago

I could not reproduce your claim:

> var Base64 = require("js-base64");
undefined
> var str='dwfedhgwefdf~12gehgdhegd';
undefined
> Base64.encode(str);
'ZHdmZWRoZ3dlZmRmfjEyZ2VoZ2RoZWdk'
> Base64.decode(Base64.encode(str));
'dwfedhgwefdf~12gehgdhegd'
> Base64.decode(Base64.encode(str)) === str;
true

Would you tell me your environment more in detail?