internal static byte[] HashStream(string hashAlgorithmId, int hashSizeInBytes, Stream source) { byte[] result = new byte[hashSizeInBytes]; LiteHash hash = CreateHash(hashAlgorithmId); int written = ProcessStream(hash, source, result); Debug.Assert(written == hashSizeInBytes); return(result); }
internal static ValueTask <byte[]> HashStreamAsync( string hashAlgorithmId, int hashSizeInBytes, Stream source, CancellationToken cancellationToken) { if (cancellationToken.IsCancellationRequested) { return(ValueTask.FromCanceled <byte[]>(cancellationToken)); } LiteHash hash = CreateHash(hashAlgorithmId); return(ProcessStreamAsync(hash, source, cancellationToken)); }
public EvpHashProvider(string hashAlgorithmId) { _liteHash = LiteHashProvider.CreateHash(hashAlgorithmId); }
internal static int HashStream(string hashAlgorithmId, int hashSizeInBytes, Stream source, Span <byte> destination) { LiteHash hash = CreateHash(hashAlgorithmId); return(ProcessStream(hash, source, destination)); }
public AppleDigestProvider(string hashAlgorithmId) { _liteHash = LiteHashProvider.CreateHash(hashAlgorithmId); }