Example #1
0
        public static byte[] CalculateBlobHash(byte[] Obj, ComputeHashType computeHash)
        {
            var docHash = new byte[0];

            if (computeHash == ComputeHashType.SHA256)
            {
                var sha = new SHA256CryptoServiceProvider();
                docHash = sha.ComputeHash(Obj);
            }
            else
            {
                var sha = new SHA1CryptoServiceProvider();
                docHash = sha.ComputeHash(Obj);
            }
            return(docHash);
        }
 //TODO Verificare se lasciare o togliere.
 public DocumentContent CalculateBlobHash(DocumentContent Content, ComputeHashType computeHash)
 {
     return new DocumentContent(CompEdObj.CalculateBlobHash(Content.Blob, computeHash));
 }