UNPKG

eth-crypto

Version:

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

17 lines (15 loc) 445 B
import { recoverPublicKey } from './recover-public-key'; import { toAddress as addressByPublicKey } from './public-key'; /** * returns the address with which the messageHash was signed * @param {string} sigString * @param {string} hash * @return {string} address */ export function recover(sigString, hash) { const pubkey = recoverPublicKey(sigString, hash); const address = addressByPublicKey(pubkey); return address; }