From 8036c301a17ea5687adb372ecd2078303774693f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 25 Jul 2017 16:48:30 -0700 Subject: [PATCH] address: fix isMixedCase. --- lib/primitives/address.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/primitives/address.js b/lib/primitives/address.js index bade0c52..43c187d0 100644 --- a/lib/primitives/address.js +++ b/lib/primitives/address.js @@ -887,10 +887,16 @@ function isMixedCase(str) { for (let i = 0; i < str.length; i++) { let ch = str.charCodeAt(i); - if (ch & 32) + if (ch >= 0x30 && ch <= 0x39) + continue; + + if (ch & 32) { + assert(ch >= 0x61 && ch <= 0x7a); lower = true; - else + } else { + assert(ch >= 0x41 && ch <= 0x5a); upper = true; + } if (lower && upper) return true;