Created
          May 18, 2022 05:32 
        
      - 
      
 - 
        
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
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 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