Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
eth-crypto/dist/es/recover.js

14 lines
429 B

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