Created
May 14, 2019 15:49
-
-
Save cyberpirate92/5e42e7f4a5ab93fd42229d051c2e934a to your computer and use it in GitHub Desktop.
This file contains 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
public void mine(int difficulty) throws NoSuchAlgorithmException { | |
String pre = ""; | |
for (; pre.length() < difficulty; pre += "0"); | |
while(!getHash().startsWith(pre)) | |
nonce++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment