aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index e4b77e2bc..7a56bf6a0 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,7 @@ function readableDate (ms) {
var time = `${hours}:${minutes.substr(-2)}:${seconds.substr(-2)}`
return `${dateStr} ${time}`
}
+
+function isHex (str) {
+ return Boolean(str.match(/^(0x)?[0-9a-fA-F]+$/))
+}