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

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