SHA1OpenNURBS

SHA1HashAlgorithm
public sealed class SHA1OpenNURBS : SHA1
Provides the OpenNURBS implementation of SHA1.

This class is provided only with the purpose of hashing. It is not meant to be used for any cryptographic purpose.

Constructors

SHA1OpenNURBS

#Since v6.0
public SHA1OpenNURBS()
Constructs a new instance of the SHA1 algorithm.

Finalizer

~SHA1OpenNURBS

#
~SHA1OpenNURBS()
Instructs the runtime to reclaim unmanaged resources if the developer forgot to call Dispose().

Methods

Dispose

#
protected override void Dispose(bool disposing)
Reclaims unmanaged resources used by this instance, and invalidates the instance. After calling this method, all other methods will always call ObjectDisposedException.
disposing (bool)true if the class user called Dispose.

FileSystemPathHash

#
public static byte[] FileSystemPathHash(string path, bool? ignoreCase = null)
Computes the SHA1 hash of a file system path, converted to UTF8.

These file system paths have identical values of FileSystemPathHash():

/x/y/z/name.ext

\x\y\z\name.ext

/x//y//z/name.ext

/x/y/a/b/c/../../../z/name.ext

/X/Y/Z/NAME.EXT (When ignoreCase is true)

path (string)A non-null path string.
ignoreCase (bool? = null)If case should be ignored. If this is null or unspecified, the operating system default is used.
A 20-byte long SHA1 hash.
ArgumentNullExceptionWhen input is null.

HashCore

#
protected override void HashCore(byte[] array, int start, int length)
Advances the hash by an input array.
array (byte[])The array.
start (int)The start of the data to consider in the array.
length (int)The used data length on the array.

HashFinal

#
protected override byte[] HashFinal()
Returns the currently computed hash.
The final hash.

Initialize

#Since v6.0
public override void Initialize()
Resets this instance of the algorithm, so that it can be used again. It is not required to call this method after creation.

StringHash

#Since v6.0
public static byte[] StringHash(string input)
Computes the SHA1 hash of a string, converted to UTF8.
input (string)
A 20-byte long SHA1 hash.
ArgumentNullExceptionWhen input is null.