class HashAlgorithm
in global :: System . Security . Cryptography
Represents the base class from which all implementations of cryptographic hash algorithms must derive.
public bool CanReuseTransform { get; }
Gets a value indicating whether the current transform can be reused.
- Returns Always .
public bool CanTransformMultipleBlocks { get; }
When overridden in a derived class, gets a value indicating whether multiple blocks can be transformed.
- Returns if multiple blocks can be transformed; otherwise, .
public byte[] ComputeHash( byte[] buffer )
Computes the hash value for the specified byte array.
bufferThe input to compute the hash code for.- Returns The computed hash code.
public byte[] ComputeHash( byte[] buffer, int offset, int count )
Computes the hash value for the specified region of the specified byte array.
bufferThe input to compute the hash code for.offsetThe offset into the byte array from which to begin using data.countThe number of bytes in the array to use as data.- Returns The computed hash code.
public byte[] ComputeHash( Stream inputStream )
Computes the hash value for the specified object.
inputStreamThe input to compute the hash code for.- Returns The computed hash code.
public static HashAlgorithm Create( string hashName )
Creates an instance of the specified implementation of a hash algorithm.
hashNameThe hash algorithm implementation to use. The following table shows the valid values for the parameter and the algorithms they map to. Parameter value Implements SHA SHA1 System.Security.Cryptography.SHA1 System.Security.Cryptography.HashAlgorithm MD5 System.Security.Cryptography.MD5 SHA256 SHA-256 System.Security.Cryptography.SHA256 SHA384 SHA-384 System.Security.Cryptography.SHA384 SHA512 SHA-512 System.Security.Cryptography.SHA512- Returns A new instance of the specified hash algorithm, or if is not a valid hash algorithm.
public byte[] Hash { get; }
Gets the value of the computed hash code.
- Returns The current value of the computed hash code.
public int HashSize { get; }
Gets the size, in bits, of the computed hash code.
- Returns The size, in bits, of the computed hash code.
public int InputBlockSize { get; }
When overridden in a derived class, gets the input block size.
- Returns The input block size.
public int OutputBlockSize { get; }
When overridden in a derived class, gets the output block size.
- Returns The output block size.
public int TransformBlock( byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset )
Computes the hash value for the specified region of the input byte array and copies the specified region of the input byte array to the specified region of the output byte array.
inputBufferThe input to compute the hash code for.inputOffsetThe offset into the input byte array from which to begin using data.inputCountThe number of bytes in the input byte array to use as data.outputBufferA copy of the part of the input array used to compute the hash code.outputOffsetThe offset into the output byte array from which to begin writing data.- Returns The number of bytes written.
public byte[] TransformFinalBlock( byte[] inputBuffer, int inputOffset, int inputCount )
Computes the hash value for the specified region of the specified byte array.
inputBufferThe input to compute the hash code for.inputOffsetThe offset into the byte array from which to begin using data.inputCountThe number of bytes in the byte array to use as data.- Returns An array that is a copy of the part of the input that is hashed.
public int GetHashCode( )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public void Initialize( )
😔 No documentation found.
public void Clear( )
😔 No documentation found.
public void Dispose( )
😔 No documentation found.
public Task<byte[]> ComputeHashAsync( Stream inputStream, CancellationToken cancellationToken = null )
😔 No documentation found.
public bool TryComputeHash( ReadOnlySpan<byte> source, Span<byte> destination, ref int bytesWritten )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public static HashAlgorithm Create( )
😔 No documentation found.