Implement usage of sha512 hash, and some fixes to code

Signed-off-by: Frca <killerfrca@gmail.com>