Example #1
0
        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();
            }
        }
Example #2
0
 public SecretHash(SecretHashType type, Hash256 hash)
 {
     Type = type;
     Hash = hash;
 }
Example #3
0
        public SecretHash ComputeSecretHash(SecretHashType type)
        {
            var hasher = GetHasher(type);

            return(new SecretHash(type, new Hash256(hasher.ComputeBytes(Bytes).GetBytes())));
        }
Example #4
0
 public SecretHash(SecretHashType type, string hash)
 {
     Type = type;
     Hash = hash;
 }