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

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