OutCast3k/coinbin — pull request #4 by bip32JP (2014-12-28 11:35:34+00:00)
Title: Preserve entropy of x

Iterative hashing without attempting to preserve entropy is not best practice.

It would be best to use PBKDF2... but this is better than currently.

I lowered iteration count to keep the same amount of time for the function. with (x).length iterations (about 1550 - 1600 for me each time), it was almost 16 times slower, and if divided by 16 the whole process took the same amount of time. (around 31 milliseconds)

Considering the length is usually around 1600 for me, that means somewhere around 100 iterations including the entirety of x in each hash concatenated with the current iteration of r.