UNPKG

eth-crypto

Version:

Cryptographic functions for ethereum and how to use them with web3 and solidity

19 lines (18 loc) 537 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.recover = recover; var _recoverPublicKey = require("./recover-public-key"); var _publicKey = require("./public-key"); /** * returns the address with which the messageHash was signed * @param {string} sigString * @param {string} hash * @return {string} address */ function recover(sigString, hash) { var pubkey = (0, _recoverPublicKey.recoverPublicKey)(sigString, hash); var address = (0, _publicKey.toAddress)(pubkey); return address; }