Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflexivity fo #.atob() & #.btoa() #61

Open
jung-kim opened this issue Oct 24, 2015 · 1 comment
Open

Reflexivity fo #.atob() & #.btoa() #61

jung-kim opened this issue Oct 24, 2015 · 1 comment

Comments

@jung-kim
Copy link

Perhaps it would be better to throw exception or have an option to have such option when length % 4 !==0 or string has white spaces.

> ByteBuffer.btoa(ByteBuffer.atob("a"))
''
> ByteBuffer.btoa(ByteBuffer.atob("ab"))
'aQ=='
> ByteBuffer.btoa(ByteBuffer.atob("abc"))
'abc='
> ByteBuffer.btoa(ByteBuffer.atob("abcd"))
'abcd'
> ByteBuffer.btoa(ByteBuffer.atob("abcde"))
'abcd'
> ByteBuffer.btoa(ByteBuffer.atob("abcdef"))
'abcdeQ=='
> ByteBuffer.btoa(ByteBuffer.atob("abcdefg"))
'abcdefg='
> ByteBuffer.btoa(ByteBuffer.atob("abcdefgh"))
'abcdefgh'
> ByteBuffer.btoa(ByteBuffer.atob("a   "))
''
> ByteBuffer.btoa(ByteBuffer.atob("a111"))
'a111'
> ByteBuffer.btoa(ByteBuffer.atob("a  c"))
'aQ=='
> ByteBuffer.btoa(ByteBuffer.atob("ab c"))
'abc='
> ByteBuffer.btoa(ByteBuffer.atob("abc"))
'abc='
@dcodeIO
Copy link
Member

dcodeIO commented Oct 25, 2015

Somehow connected to #60

Currently trying to resolve any encoding issues by adding ByteBuffer-aware implementations, see: https://github.com/dcodeIO/bytebuffer.js/tree/master/src/encodings/impl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants