diff options
Diffstat (limited to 'ui/app/util.js')
-rw-r--r-- | ui/app/util.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js index e4b77e2bc..facaef3ee 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -35,6 +35,7 @@ module.exports = { normalizeNumberToWei: normalizeNumberToWei, valueTable: valueTable, bnTable: bnTable, + isHex: isHex, } function valuesFor (obj) { @@ -209,3 +210,8 @@ function readableDate (ms) { var time = `${hours}:${minutes.substr(-2)}:${seconds.substr(-2)}` return `${dateStr} ${time}` } + +function isHex (str) { + if (str.match(/[g-zG-Z]/) || str.match(/\W/)) return false + return true +} |