aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcaktux <caktux@gmail.com>2014-12-31 00:59:33 +0800
committercaktux <caktux@gmail.com>2014-12-31 00:59:33 +0800
commit1954b878191e08db04188f0934b15ebe8c2c5a84 (patch)
tree45bad684c27ed1eb8a5bef7e830a6265a81c10f6
parent123098ce79562be0d4ce87e15bcebe6a970f1ff6 (diff)
downloadgo-tangerine-1954b878191e08db04188f0934b15ebe8c2c5a84.tar
go-tangerine-1954b878191e08db04188f0934b15ebe8c2c5a84.tar.gz
go-tangerine-1954b878191e08db04188f0934b15ebe8c2c5a84.tar.bz2
go-tangerine-1954b878191e08db04188f0934b15ebe8c2c5a84.tar.lz
go-tangerine-1954b878191e08db04188f0934b15ebe8c2c5a84.tar.xz
go-tangerine-1954b878191e08db04188f0934b15ebe8c2c5a84.tar.zst
go-tangerine-1954b878191e08db04188f0934b15ebe8c2c5a84.zip
bring back toHex
-rw-r--r--lib/main.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/main.js b/lib/main.js
index 59c60cfa8..b6601132d 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -227,6 +227,16 @@ var web3 = {
_events: {},
providers: {},
+ toHex: function(str) {
+ var hex = "";
+ for(var i = 0; i < str.length; i++) {
+ var n = str.charCodeAt(i).toString(16);
+ hex += n.length < 2 ? '0' + n : n;
+ }
+
+ return hex;
+ },
+
toAscii: function(hex) {
// Find termination
var str = "";