Make MekaCrc official

This commit is contained in:
Matt Nadareski
2025-09-25 07:51:44 -04:00
parent bdde3bad16
commit 53e28df7f8
5 changed files with 18 additions and 1 deletions

View File

@@ -172,6 +172,8 @@ namespace SabreTools.Hashing.Test
{HashType.FNV1a_32, "9086769b"},
{HashType.FNV1a_64, "399dd1cd965b73db"},
{HashType.MekaCrc, "0a0a0b1174052f22"},
{HashType.MD2, "362e1a6931668e6a9de5c159c52c71b5"},
{HashType.MD4, "61bef59d7a754874fccbd67b4ec2fb10"},
{HashType.MD5, "b722871eaa950016296184d026c5dec9"},

View File

@@ -167,6 +167,8 @@ namespace SabreTools.Hashing
HashType.FNV1a_32 => "FNV hash (Variant 1a, 32-bit)",
HashType.FNV1a_64 => "FNV hash (Variant 1a, 64-bit)",
HashType.MekaCrc => "Custom MEKA checksum",
HashType.MD2 => "MD2 message-digest algorithm",
HashType.MD4 => "MD4 message-digest algorithm",
HashType.MD5 => "MD5 message-digest algorithm",
@@ -391,6 +393,8 @@ namespace SabreTools.Hashing
"fnv1a_32" => HashType.FNV1a_32,
"fnv1a_64" => HashType.FNV1a_64,
"meka" or "mekacrc" or "meka_crc" => HashType.MekaCrc,
"md2" => HashType.MD2,
"md4" => HashType.MD4,
"md5" => HashType.MD5,

View File

@@ -756,6 +756,11 @@ namespace SabreTools.Hashing
#endregion
/// <summary>
/// Custom checksum used by MEKA
/// </summary>
MekaCrc,
#region Message Digest
/// <summary>

View File

@@ -237,12 +237,14 @@ namespace SabreTools.Hashing
HashType.FNV1a_32 => new FNV1a_32(),
HashType.FNV1a_64 => new FNV1a_64(),
HashType.MekaCrc => new MekaCrc(),
HashType.MD2 => new MD2(),
HashType.MD4 => new MD4(),
HashType.MD5 => MD5.Create(),
HashType.RIPEMD128 => new RipeMD128(),
HashType.RIPEMD160 => new CryptographicHash.RipeMD160(),
HashType.RIPEMD160 => new RipeMD160(),
HashType.RIPEMD256 => new RipeMD256(),
HashType.RIPEMD320 => new RipeMD320(),

View File

@@ -250,6 +250,8 @@ namespace SabreTools.Hashing
{HashType.FNV1a_32, [0x81, 0x1c, 0x9d, 0xc5]},
{HashType.FNV1a_64, [0xcb, 0xf2, 0x9c, 0xe4, 0x84, 0x22, 0x23, 0x25]},
{HashType.MekaCrc, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]},
{HashType.MD2, [0x83, 0x50, 0xe5, 0xa3, 0xe2, 0x4c, 0x15, 0x3d,
0xf2, 0x27, 0x5c, 0x9f, 0x80, 0x69, 0x27, 0x73]},
{HashType.MD4, [0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31,
@@ -550,6 +552,8 @@ namespace SabreTools.Hashing
{HashType.FNV1a_32, "811c9dc5"},
{HashType.FNV1a_64, "cbf29ce484222325"},
{HashType.MekaCrc, "0000000000000000"},
{HashType.MD2, "8350e5a3e24c153df2275c9f80692773"},
{HashType.MD4, "31d6cfe0d16ae931b73c59d7e0c089c0"},
{HashType.MD5, "d41d8cd98f00b204e9800998ecf8427e"},