refactor and add sha512primesums hash