mvillaluz22 / crypto-js

Automatically exported from code.google.com/p/crypto-js
0 stars 0 forks source link

Base64 parsing should skip spaces and newlines #77

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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