Skip to content

Instantly share code, notes, and snippets.

@aheissenberger
Created March 2, 2019 09:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
create a wallet address (ethereum)
const crypto = require("crypto");
var ethUtils = require("ethereumjs-util");
var getRandomWallet = function() {
var randbytes = crypto.randomBytes(32);
var address = "0x" + ethUtils.privateToAddress(randbytes).toString("hex");
return { address: address, privKey: randbytes.toString("hex") };
};
console.log(getRandomWallet().address)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment