From 818fe7e67c3f67d3b34529f6f49fe041d836ed35 Mon Sep 17 00:00:00 2001 From: Boris Kubiak Date: Thu, 25 Oct 2018 08:33:33 +0200 Subject: [PATCH] Increase browser compatibility --- src/js/vanity.js | 2 +- src/vue/Input.vue | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/vanity.js b/src/js/vanity.js index d699b2b..b3d4ccf 100644 --- a/src/js/vanity.js +++ b/src/js/vanity.js @@ -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()}); } }; diff --git a/src/vue/Input.vue b/src/vue/Input.vue index 6109484..340ab54 100644 --- a/src/vue/Input.vue +++ b/src/vue/Input.vue @@ -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; }