make things work in the browser by fixing sha512

...had to use jsSHA package to do SHA512 in the browser. Unfortunately it is
quite slow compared to node.