jproulx / crypto-js

Automatically exported from code.google.com/p/crypto-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Base64 parsing should skip spaces and newlines

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. CryptoJS.enc.Latin1.stringify(CryptoJS.enc.Base64.parse('YWJj\nZA==\n')) == 
'abcd'

What is the expected output? What do you see instead?
Expected is true, but it's false.

Please provide any additional information below.

Can be fixed by adding the following line to the beginning of the parse 
function:

base64Str = base64Str.replace(/[^a-z0-9+/=]/gi, '')

Original issue reported on code.google.com by BiX...@googlemail.com on 13 Feb 2013 at 11:00