Increase browser compatibility

This commit is contained in:
Boris Kubiak 2018-10-25 08:33:33 +02:00
parent c104df77a0
commit 818fe7e67c
2 changed files with 4 additions and 3 deletions

View file

@ -97,7 +97,7 @@ onmessage = function (event) {
try {
getVanityWallet(input.hex, input.checksum, input.suffix, (message) => postMessage(message));
} catch (err) {
self.postMessage({error: err.toString()}, '*');
self.postMessage({error: err.toString()});
}
};

View file

@ -66,8 +66,9 @@
function mixCase(str) {
let ret = '';
for (let i of str) {
ret += Math.random() < 0.5 ? i.toUpperCase() : i.toLowerCase();
for (let i = 0; i < str.length; i++) {
const l = str.substr(i, 1);
ret += Math.random() < 0.5 ? l.toUpperCase() : l.toLowerCase();
}
return ret;
}