Added alphabet check before decoding #7
6
test.js
6
test.js
|
@ -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 (_) {
|
||||||
|
|
Loading…
Reference in New Issue