Last active
June 14, 2016 06:06
-
-
Save bkawk/b529350ed40e5bd014c51864e7dd76c5 to your computer and use it in GitHub Desktop.
Search for your name in a bitcoin address
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
var bitcoin = require('bitcoinjs-lib') | |
var fs = require("fs") | |
function randomString(length, chars) { | |
var result = ''; | |
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]; | |
return result; | |
} | |
function makePair(params) { | |
var rand = randomString(32, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); | |
function rng () { return new Buffer(rand) } | |
var keyPair = bitcoin.ECPair.makeRandom({ rng: rng }); | |
var address = keyPair.getAddress(); | |
var name = "Will"; | |
var result = address.indexOf(name) > -1; | |
if(result == true){ | |
fs.writeFile(address+'.txt', keyPair.getAddress()+" "+keyPair.toWIF(), function(err) { | |
if (err) { | |
return console.error(err); | |
} | |
}); | |
} | |
} | |
(function () { | |
console.log('Sarching for a bitcoin address with your name in it....'); | |
setInterval(function(){ | |
makePair(); | |
}, 1/1000); | |
})(); |
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
{ | |
"name": "bitname", | |
"version": "1.0.0", | |
"description": "Search for your name in a bitcoin address", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Will In China @bkawk", | |
"license": "MIT", | |
"dependencies": { | |
"bitcoinjs-lib": "^2.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment