Skip to content

Instantly share code, notes, and snippets.

@matheusml
Created December 6, 2017 18:15
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 matheusml/9c7e4252ccded53f7d1cdafb6f5a53e3 to your computer and use it in GitHub Desktop.
Save matheusml/9c7e4252ccded53f7d1cdafb6f5a53e3 to your computer and use it in GitHub Desktop.
mine() {
this.hash = this.generateHash()
while (!(/^0*$/.test(this.hash.substring(0, this.difficulty)))) {
this.nonce++
this.hash = this.generateHash()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment