private IHash GetHasher(SecretHashType type) { switch (type) { case SecretHashType.SHA3: return(HashFactory.Crypto.SHA3.CreateKeccak256()); case SecretHashType.SHA256: return(HashFactory.Crypto.CreateSHA256()); default: throw new NotImplementedException(); } }
public SecretHash(SecretHashType type, Hash256 hash) { Type = type; Hash = hash; }
public SecretHash ComputeSecretHash(SecretHashType type) { var hasher = GetHasher(type); return(new SecretHash(type, new Hash256(hasher.ComputeBytes(Bytes).GetBytes()))); }
public SecretHash(SecretHashType type, string hash) { Type = type; Hash = hash; }