v1.1.9: bugfix Node.js atob invocation #2

Open
Ghost wants to merge 1 commits from (deleted):nodejs-atob into master
2 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ PEM.parseBlock = PEM.parseBlock || function (str) {
};
Enc.base64ToBuf = function (b64) {
return Enc.binToBuf(atob(b64));
return Enc.binToBuf('function' === typeof atob ? atob(b64) : Buffer.from(b64, 'base64').toString('binary'));
};
Enc.binToBuf = function (bin) {
var arr = bin.split('').map(function (ch) {

View File

@ -1,6 +1,6 @@
{
"name": "asn1-parser",
"version": "1.1.8",
"version": "1.1.9",
"description": "An ASN.1 parser in less than 100 lines of Vanilla JavaScript, part of the Bluecrypt suite.",
"homepage": "https://git.coolaj86.com/coolaj86/asn1-parser.js",
"main": "asn1-parser.js",