this post was submitted on 19 Jun 2024
3 points (100.0% liked)
Hacker News
2171 readers
1 users here now
A mirror of Hacker News' best submissions.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
OK... here's some dumb bash shit.
Feel free to use it. Just make sure to change
lvxferre/Hello+Fediverse+
to something else.What it does: it generates the SHA256sum for strings starting with whatever you want, and ending in a number, between 0 and 10¹². Then if it finds one starting with "z" zeroes, it prints it alongside the number; then it looks for strings with an additional zero at the start. Each million tests it'll also print some output so you know that the script didn't freeze.
Update: so far my best string was
lvxferre/Hello+Fediverse+2393194
, yielding0000006a 48...
I also did some simple optimisations of the code. Basically "the least you do, the faster it'll be".
Now it'll show results with more than five leading zeroes, and print a message every 100k tries (to resume later on).
My machine is a potato, mind you. I don't expect to get into the leaderboard. Still, I'm doing this as a bash exercise.