mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-09 20:59:02 +00:00
bring back toHex
This commit is contained in:
parent
123098ce79
commit
1954b87819
1 changed files with 10 additions and 0 deletions
10
lib/main.js
10
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 = "";
|
||||
|
|
|
|||
Loading…
Reference in a new issue