|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { |
|
|
|
|
value: true |
|
|
|
|
value: true |
|
|
|
|
}); |
|
|
|
|
exports['default'] = publicKeyOfPrivateKey; |
|
|
|
|
|
|
|
|
@ -9,6 +9,8 @@ var _ethereumjsUtil = require('ethereumjs-util'); |
|
|
|
|
|
|
|
|
|
var _ethereumjsUtil2 = _interopRequireDefault(_ethereumjsUtil); |
|
|
|
|
|
|
|
|
|
var _util = require('./util'); |
|
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -18,6 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd |
|
|
|
|
* @returns {string} |
|
|
|
|
*/ |
|
|
|
|
function publicKeyOfPrivateKey(privateKey) { |
|
|
|
|
var publicKeyBuffer = _ethereumjsUtil2['default'].privateToPublic(privateKey); |
|
|
|
|
return publicKeyBuffer.toString('hex'); |
|
|
|
|
privateKey = (0, _util.addTrailing0x)(privateKey); |
|
|
|
|
var publicKeyBuffer = _ethereumjsUtil2['default'].privateToPublic(privateKey); |
|
|
|
|
return publicKeyBuffer.toString('hex'); |
|
|
|
|
} |