|
|
|
@ -118,8 +118,21 @@ module.exports = class PersonalMessageManager extends EventEmitter{ |
|
|
|
|
log.debug(`Message was not hex encoded, interpreting as utf8.`) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ethUtil.bufferToHex(new Buffer(data, 'utf8')) |
|
|
|
|
return hexEncode(data) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hexEncode(text){ |
|
|
|
|
var hex, i |
|
|
|
|
|
|
|
|
|
var result = '' |
|
|
|
|
for (i = 0; i < text.length; i++) { |
|
|
|
|
hex = text.charCodeAt(i).toString(16) |
|
|
|
|
result += ('000'+hex).slice(-4) |
|
|
|
|
} |
|
|
|
|
return '0x' + result |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|