Crc32 類別

定義

提供 CRC-32 演算法的實作,該演算法用於 ITU-T V.42 與 IEEE 802.3。

public ref class Crc32 sealed : System::IO::Hashing::NonCryptographicHashAlgorithm
public sealed class Crc32 : System.IO.Hashing.NonCryptographicHashAlgorithm
type Crc32 = class
    inherit NonCryptographicHashAlgorithm
Public NotInheritable Class Crc32
Inherits NonCryptographicHashAlgorithm
繼承

備註

此實作以小恩迪安位元組順序輸出答案,使得 CRC 殘餘關係(CRC(訊息 concat CRC(message))為固定值)成立。 對於 CRC-32,這個穩定輸出是位元組序列 { 0x1C, 0xDF, 0x44, 0x21 },即 的 0x2144DF1CLittle Endian 表示。

32位元循環冗餘檢查(CRC)演算法有多種不相容的定義。 與其他系統互通時,請確保使用相同的定義。 此實作所使用的定義與 I.363.5 ITU-T 描述的循環冗餘檢查不相容。

建構函式

名稱 Description
Crc32()

初始化 Crc32 類別的新執行個體。

Crc32(Crc32ParameterSet)

提供 CRC-32 演算法的實作,該演算法用於 ITU-T V.42 與 IEEE 802.3。

屬性

名稱 Description
HashLengthInBytes

取得此雜湊演算法產生的位元組數。

(繼承來源 NonCryptographicHashAlgorithm)
ParameterSet

提供 CRC-32 演算法的實作,該演算法用於 ITU-T V.42 與 IEEE 802.3。

方法

名稱 Description
Append(Byte[])

將 的內容 source 附加到目前雜湊計算中已處理的資料。

(繼承來源 NonCryptographicHashAlgorithm)
Append(ReadOnlySpan<Byte>)

將 的內容 source 附加到目前雜湊計算中已處理的資料。

Append(Stream)

將 的內容 stream 附加到目前雜湊計算中已處理的資料。

(繼承來源 NonCryptographicHashAlgorithm)
AppendAsync(Stream, CancellationToken)

非同步讀取 的內容 stream ,並將其附加到目前雜湊計算中已處理的資料中。

(繼承來源 NonCryptographicHashAlgorithm)
Clone()

建立一個目前實例的克隆,並複製該實例的內部狀態。

GetCurrentHash()

取得目前計算出的雜湊值,且不修改累積狀態。

(繼承來源 NonCryptographicHashAlgorithm)
GetCurrentHash(Span<Byte>)

將計算出的雜湊值寫入 destination ,且不修改累積狀態。

(繼承來源 NonCryptographicHashAlgorithm)
GetCurrentHashAsUInt32()

取得目前計算出的雜湊值,且不修改累積狀態。

GetCurrentHashCore(Span<Byte>)

當在導出類別中覆寫時,會將計算出來的雜湊值寫入 destination ,且不修改累積狀態。

(繼承來源 NonCryptographicHashAlgorithm)
GetHashAndReset()

取得目前計算的雜湊值並清除累積狀態。

(繼承來源 NonCryptographicHashAlgorithm)
GetHashAndReset(Span<Byte>)

將計算出的雜湊值寫入, destination 然後清除累積狀態。

(繼承來源 NonCryptographicHashAlgorithm)
GetHashAndResetCore(Span<Byte>)

將計算出的雜湊值寫入, destination 然後清除累積狀態。

(繼承來源 NonCryptographicHashAlgorithm)
GetHashCode()
已淘汰.

此方法不被支援,不應被呼叫。 打電話 GetCurrentHash()GetHashAndReset() 改打。

(繼承來源 NonCryptographicHashAlgorithm)
Hash(Byte[])

計算所提供資料的 CRC-32 雜湊值。

Hash(Crc32ParameterSet, Byte[])

提供 CRC-32 演算法的實作,該演算法用於 ITU-T V.42 與 IEEE 802.3。

Hash(Crc32ParameterSet, ReadOnlySpan<Byte>, Span<Byte>)

提供 CRC-32 演算法的實作,該演算法用於 ITU-T V.42 與 IEEE 802.3。

Hash(Crc32ParameterSet, ReadOnlySpan<Byte>)

提供 CRC-32 演算法的實作,該演算法用於 ITU-T V.42 與 IEEE 802.3。

Hash(ReadOnlySpan<Byte>, Span<Byte>)

計算所提供資料的CRC-32雜湊值轉換為目的地。

Hash(ReadOnlySpan<Byte>)

計算所提供資料的 CRC-32 雜湊值。

HashToUInt32(Crc32ParameterSet, ReadOnlySpan<Byte>)

提供 CRC-32 演算法的實作,該演算法用於 ITU-T V.42 與 IEEE 802.3。

HashToUInt32(ReadOnlySpan<Byte>)

計算所提供資料的 CRC-32 雜湊值。

Reset()

將雜湊計算重設到初始狀態。

TryGetCurrentHash(Span<Byte>, Int32)

嘗試在不修改累積狀態的情況下,將計算出的雜湊值寫入 。destination

(繼承來源 NonCryptographicHashAlgorithm)
TryGetHashAndReset(Span<Byte>, Int32)

嘗試將計算出的雜湊值寫入 destination。 若成功,則清除累積狀態。

(繼承來源 NonCryptographicHashAlgorithm)
TryHash(Crc32ParameterSet, ReadOnlySpan<Byte>, Span<Byte>, Int32)

提供 CRC-32 演算法的實作,該演算法用於 ITU-T V.42 與 IEEE 802.3。

TryHash(ReadOnlySpan<Byte>, Span<Byte>, Int32)

嘗試計算所提供資料的CRC-32雜湊值,轉換為目的地。

適用於