This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ethUtil = require('ethereumjs-util'); | |
var data = 'Login'; | |
var message = ethUtil.toBuffer(data); | |
var msgHash = ethUtil.hashPersonalMessage(message); | |
var privateKey = new Buffer('62debf78d596673bce224a85a90da5aecf6e781d9aadcaedd4f65586cfe670d2', "hex") | |
var sig = ethUtil.ecsign(msgHash, privateKey); | |
var signature = ethUtil.toBuffer(sig) |