Added alphabet check before decoding #7
6
test.js
6
test.js
|
@ -2,9 +2,9 @@
|
|||
"use strict";
|
||||
|
||||
var atob = require('.');
|
||||
var encoded = "SGVsbG8sIFdvcmxkIQ=="
|
||||
var encoded = "SGVsbG8sIFdvcmxkIQ==";
|
||||
var unencoded = "Hello, World!";
|
||||
var malformed = "SGVsbG8s{"
|
||||
var malformed = "SGVsbG8s{";
|
||||
/*
|
||||
, encoded = "SGVsbG8sIBZM"
|
||||
, unencoded = "Hello, 世界"
|
||||
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
|
||||
try {
|
||||
const decoded = atob(malformed)
|
||||
var decoded = atob(malformed);
|
||||
console.log('[FAIL]', malformed, decoded);
|
||||
return;
|
||||
} catch (_) {
|
||||
|
|
Loading…
Reference in New Issue