Range check for b64 Alphabet

This commit is contained in:
Michael Theos 2021-03-12 00:27:22 +11:00
parent ca3678cddb
commit 34dd70eb8d
1 changed files with 3 additions and 3 deletions

View File

@ -2,9 +2,9 @@
"use strict"; "use strict";
var atob = require('.'); var atob = require('.');
var encoded = "SGVsbG8sIFdvcmxkIQ==" var encoded = "SGVsbG8sIFdvcmxkIQ==";
var unencoded = "Hello, World!"; var unencoded = "Hello, World!";
var malformed = "SGVsbG8s{" var malformed = "SGVsbG8s{";
/* /*
, encoded = "SGVsbG8sIBZM" , encoded = "SGVsbG8sIBZM"
, unencoded = "Hello, 世界" , unencoded = "Hello, 世界"
@ -16,7 +16,7 @@
} }
try { try {
const decoded = atob(malformed) var decoded = atob(malformed);
console.log('[FAIL]', malformed, decoded); console.log('[FAIL]', malformed, decoded);
return; return;
} catch (_) { } catch (_) {