Fix generation of SHA-256 and SHA-512 hashes