Xceed Encryption Library Documentation
Examples / Hashing a file (C# example)
In This Topic
    Hashing a file (C# example)
    In This Topic
    C# Copy Code

    XceedEncryptionLib.XceedHashing hasher = new XceedEncryptionLib.XceedHashingClass();

    hasher.License( @"your license key" );      

    try
    {
      XceedEncryptionLib.XceedSHAHashingMethod sha = new XceedEncryptionLib.XceedSHAHashingMethodClass(); 

      sha.HashSize = 256;

      hasher.HashingMethod = sha; 
      hasher.ReadFile( @"c:\test\file.txt", 0, 0, XceedEncryptionLib.EXEFileProcessing.efpHash, true );

      object hash = sha.HashValue;      
    }
    catch( System.Runtime.InteropServices.COMException except )
    {
      MessageBox.Show( except.ToString() );
    }