Re:Show HN: SHAllenge – Compete to get the lowest Hash
by amenhotep on Saturday June 15, 2024 @10:37PM
(#40694292)
There is really no point randomising at all, any cycles you spend on it are a total waste - one of the most important properties of a good hash algorithm is that a one bit change in the input should result in an output that's completely unrelated to the previous.
Your random number generator is pretty much equivalent to feeding a counter into SHA256, so using it as input is pretty much equivalent to hashing a counter twice. There's no point!
Re:Show HN: SHAllenge – Compete to get the lowest Hash
by NAHWheatCracker on Saturday June 15, 2024 @11:00PM
(#40694363)
Yea, I know. It makes me feel better this way, though.
Re:Show HN: SHAllenge – Compete to get the lowest Hash
by NAHWheatCracker on Saturday June 15, 2024 @11:49PM
(#40694554)
BTW, I changed it so it's iterative, getting 12.5 MH/s.
I was able to optimize it so that I only call rand.Int63 twice per string generation, bringing the CPU time of that part down to 10-15%. I'm getting 11.3 MH/s now!