mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
Merge pull request #310 from darkdarkdragon/release-base-decode-fix
[FIX] fix Base:decode
This commit is contained in:
@@ -56,7 +56,7 @@ function decodeString(indexes, input) {
|
||||
|
||||
var input58 = input.split('').map(function(c) {
|
||||
var charCode = c.charCodeAt(0);
|
||||
if (charCode >= indexes.length) {
|
||||
if (charCode >= indexes.length || indexes[charCode] === -1) {
|
||||
throw new Error('Character ' + c + ' is not valid for encoding');
|
||||
}
|
||||
return indexes[charCode];
|
||||
|
||||
Reference in New Issue
Block a user