Skip to content

Instantly share code, notes, and snippets.

@yxy
Created May 18, 2022 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yxy/d37a409965a2ada9e55cbed37db32347 to your computer and use it in GitHub Desktop.
Save yxy/d37a409965a2ada9e55cbed37db32347 to your computer and use it in GitHub Desktop.
A gist to generate last N repeated characters Tron account based on tronweb
// N x repeated characters
const LEN = process.argv.length > 2 ? parseInt(process.argv[2]) : 4
console.log('LEN: ' + LEN)
function check(s) {
let i = s.length - LEN
const p = s.charAt(i)
for (i++; i<s.length; i++) {
if (p != s.charAt(i)) {
return false
}
}
return true
}
function parse(data) {
const addr = data.address.base58
if (check(addr)) {
console.log('found: ' + addr)
fs.writeFileSync('./output/' + addr, JSON.stringify(data))
}
}
function main() {
TronWeb.createAccount().then(parse).catch(console.error)
}
setInterval(main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment