Skip to content

Commit

Permalink
bring back toHex
Browse files Browse the repository at this point in the history
  • Loading branch information
caktux committed Dec 30, 2014
1 parent 123098c commit 1954b87
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down

0 comments on commit 1954b87

Please sign in to comment.