long nonce;
String message = "blahblabahlsdhqwi";
String digest = digest("SHA-256", String + nonce);
byte[] digestBytes = digest.getBytes();
I'm trying to hash through a message whilst incrementing a nonce until I find a digest that has the first 4 bytes that are 0's. How can I do this?
It took me about two and a half minutes to find: "blahblabahlsdhqwi164370510". I checked it online and that confirmed the hash:
My code looks like: