Skip to content

Instantly share code, notes, and snippets.

@timelf123
Created January 24, 2018 13:22
Show Gist options
  • Save timelf123/37a14f37a91af302c18e6330aeb2045c to your computer and use it in GitHub Desktop.
Save timelf123/37a14f37a91af302c18e6330aeb2045c to your computer and use it in GitHub Desktop.
Generate ETH address with 00 at the end.
const Web3 = require('web3');
const provider = new Web3.providers.HttpProvider('http://localhost:8549');
const web3 = new Web3(provider);
let acc = web3.eth.accounts.create();
let last = acc.address[acc.address.length-2];
let last2 = acc.address.slice(acc.address.length - 2, acc.address.length );
console.log(last2);
while(last2 != '00' ){
acc = web3.eth.accounts.create();
last = acc.address[acc.address.length-1];
last2 = acc.address.slice(acc.address.length - 2, acc.address.length );
// console.log(last2);
}
console.log(acc);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment