| ▲ | drum55 4 hours ago | |||||||
It doesn't matter if your hottest loop is using string comparisons, as another poster pointed out in C you aren't even doing the majority of the second hash because you know the result (or enough of it) before finishing it. The JavaScript version just does whole hashes and turns them into a Uint8Array, then iterates through it. | ||||||||
| ▲ | bawolff an hour ago | parent [-] | |||||||
I dont understand what you mean. Are you saying that in C you only calculate the first few digits of the hash? That's not how sha256 works. Edit: oh i think you mean in c the string comparison short curcuits. I would expect the same to be true in javascript too. Its true in most languages. Maybe you are just worried about general language overhead, which is a fair point. Is the anubis check even using multiple threads? For the c case, the real benefit wouldn't be if you can use C, but if you can use the GPU. The whole thing is kind of silly though. SHA256 is a terrible choice of hash for PoW. They should be using argon2 or something memory heavy. | ||||||||
| ||||||||