mirror of
https://github.com/SabreTools/SabreTools.Hashing.git
synced 2026-11-15 17:00:27 +00:00
Add HashSize property for all implementations
This commit is contained in:
@@ -6,6 +6,9 @@ namespace SabreTools.Hashing.Checksum
|
||||
/// <see href="https://github.com/madler/zlib/blob/v1.2.11/adler32.c"/>
|
||||
public class Adler32 : ChecksumBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 32;
|
||||
|
||||
public Adler32()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
@@ -5,6 +5,9 @@ namespace SabreTools.Hashing.Checksum
|
||||
{
|
||||
public class Crc : ChecksumBase<ulong>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => Def.Width;
|
||||
|
||||
/// <summary>
|
||||
/// Definition used to create the runner
|
||||
/// </summary>
|
||||
|
||||
@@ -3,6 +3,9 @@ namespace SabreTools.Hashing.Checksum
|
||||
/// <see href="https://en.wikipedia.org/wiki/Fletcher%27s_checksum#Optimizations"/>
|
||||
public class Fletcher16 : ChecksumBase<ushort>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 16;
|
||||
|
||||
public Fletcher16()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
@@ -6,6 +6,9 @@ namespace SabreTools.Hashing.Checksum
|
||||
/// <remarks>Uses an Adler-32-like implementation instead of the above</remarks>
|
||||
public class Fletcher32 : ChecksumBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 32;
|
||||
|
||||
public Fletcher32()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
@@ -6,6 +6,9 @@ namespace SabreTools.Hashing.Checksum
|
||||
/// <remarks>Uses an Adler-32-like implementation instead of the above</remarks>
|
||||
public class Fletcher64 : ChecksumBase<ulong>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 64;
|
||||
|
||||
public Fletcher64()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
@@ -6,6 +6,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// <see href="https://datatracker.ietf.org/doc/html/rfc1115"/>
|
||||
public class MD2 : MessageDigestBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 128;
|
||||
|
||||
/// <summary>
|
||||
/// Buffer for forming digest in
|
||||
/// </summary>
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// <see href="https://datatracker.ietf.org/doc/html/rfc1320"/>
|
||||
public class MD4 : MessageDigestBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 128;
|
||||
|
||||
/// <summary>
|
||||
/// Set of 4 32-bit numbers representing the hash state
|
||||
/// </summary>
|
||||
|
||||
@@ -8,6 +8,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// <see href="https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf"/>
|
||||
public class RipeMD128 : MessageDigestBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 128;
|
||||
|
||||
/// <summary>
|
||||
/// Set of 4 32-bit numbers representing the hash state
|
||||
/// </summary>
|
||||
|
||||
@@ -8,6 +8,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// <see href="https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf"/>
|
||||
public class RipeMD160 : MessageDigestBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 160;
|
||||
|
||||
/// <summary>
|
||||
/// Set of 5 32-bit numbers representing the hash state
|
||||
/// </summary>
|
||||
|
||||
@@ -8,6 +8,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// <see href="https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf"/>
|
||||
public class RipeMD256 : MessageDigestBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 256;
|
||||
|
||||
/// <summary>
|
||||
/// Set of 4 32-bit numbers representing the hash state
|
||||
/// </summary>
|
||||
|
||||
@@ -8,6 +8,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// <see href="https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf"/>
|
||||
public class RipeMD320 : MessageDigestBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 320;
|
||||
|
||||
/// <summary>
|
||||
/// Set of 10 32-bit numbers representing the hash state
|
||||
/// </summary>
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger128_3 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 128;
|
||||
|
||||
public Tiger128_3() : base()
|
||||
{
|
||||
_passes = 3;
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger128_4 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 128;
|
||||
|
||||
public Tiger128_4() : base()
|
||||
{
|
||||
_passes = 4;
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger160_3 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 160;
|
||||
|
||||
public Tiger160_3() : base()
|
||||
{
|
||||
_passes = 3;
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger160_4 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 160;
|
||||
|
||||
public Tiger160_4() : base()
|
||||
{
|
||||
_passes = 4;
|
||||
|
||||
@@ -5,6 +5,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger192_3 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 192;
|
||||
|
||||
public Tiger192_3() : base()
|
||||
{
|
||||
_passes = 3;
|
||||
|
||||
@@ -5,6 +5,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger192_4 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 192;
|
||||
|
||||
public Tiger192_4() : base()
|
||||
{
|
||||
_passes = 4;
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger2_128_3 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 128;
|
||||
|
||||
public Tiger2_128_3() : base()
|
||||
{
|
||||
_passes = 3;
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger2_128_4 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 128;
|
||||
|
||||
public Tiger2_128_4() : base()
|
||||
{
|
||||
_passes = 4;
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger2_160_3 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 160;
|
||||
|
||||
public Tiger2_160_3() : base()
|
||||
{
|
||||
_passes = 3;
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger2_160_4 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 160;
|
||||
|
||||
public Tiger2_160_4() : base()
|
||||
{
|
||||
_passes = 4;
|
||||
|
||||
@@ -5,6 +5,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger2_192_3 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 192;
|
||||
|
||||
public Tiger2_192_3() : base()
|
||||
{
|
||||
_passes = 3;
|
||||
|
||||
@@ -5,6 +5,9 @@ namespace SabreTools.Hashing.CryptographicHash
|
||||
/// </summary>
|
||||
public class Tiger2_192_4 : TigerHashBase
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 192;
|
||||
|
||||
public Tiger2_192_4() : base()
|
||||
{
|
||||
_passes = 4;
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace SabreTools.Hashing.NonCryptographicHash
|
||||
{
|
||||
public class FNV0_32 : FnvBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 32;
|
||||
|
||||
public FNV0_32()
|
||||
{
|
||||
_basis = 0;
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace SabreTools.Hashing.NonCryptographicHash
|
||||
{
|
||||
public class FNV0_64 : FnvBase<ulong>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 64;
|
||||
|
||||
public FNV0_64()
|
||||
{
|
||||
_basis = 0;
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace SabreTools.Hashing.NonCryptographicHash
|
||||
{
|
||||
public class FNV1_32 : FnvBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 32;
|
||||
|
||||
public FNV1_32()
|
||||
{
|
||||
_basis = FNV32Basis;
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace SabreTools.Hashing.NonCryptographicHash
|
||||
{
|
||||
public class FNV1_64 : FnvBase<ulong>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 64;
|
||||
|
||||
public FNV1_64()
|
||||
{
|
||||
_basis = FNV64Basis;
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace SabreTools.Hashing.NonCryptographicHash
|
||||
{
|
||||
public class FNV1a_32 : FnvBase<uint>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 32;
|
||||
|
||||
public FNV1a_32()
|
||||
{
|
||||
_basis = FNV32Basis;
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace SabreTools.Hashing.NonCryptographicHash
|
||||
{
|
||||
public class FNV1a_64 : FnvBase<ulong>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 64;
|
||||
|
||||
public FNV1a_64()
|
||||
{
|
||||
_basis = FNV64Basis;
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace SabreTools.Hashing.NonCryptographicHash
|
||||
{
|
||||
public class XxHash32 : System.Security.Cryptography.HashAlgorithm
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 32;
|
||||
|
||||
/// <summary>
|
||||
/// The 32-bit seed to alter the hash result predictably.
|
||||
/// </summary>
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace SabreTools.Hashing.NonCryptographicHash
|
||||
{
|
||||
public class XxHash64 : System.Security.Cryptography.HashAlgorithm
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override int HashSize => 64;
|
||||
|
||||
/// <summary>
|
||||
/// The 64-bit seed to alter the hash result predictably.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user