mirror of
https://github.com/SabreTools/SabreTools.Hashing.git
synced 2026-02-04 05:36:04 +00:00
4a9fc1a144dc7632900457dfc5644b1728d15d10
SabreTools.Hashing
This library comprises of methods and helpers to simplify the process of getting checksums and hashes from both files and streams.
Internal Implementations
All hash and checksum types here have been written to ensure compatibility across all .NET versions. Some may have been adapted to ensure this compatibility. These can be treated as reference implementations, not always optimized.
| Hash / Checksum Type | Notes |
|---|---|
| Adler-32 | Based on the zlib source code |
| CRC | All CRC values documented here except for CRC-82 due to bit-length restrictions |
| Fletcher | 16-, 32-, and 64-bit variants |
| FNV | 32-, and 64-bit variants; 0, 1, and 1a algorithms |
| Message Digest | MD2 and MD4 only |
| RIPEMD | 128-, 160-, 256-, and 320-bit variants |
| Tiger | 128-, 160-, and 192-bit variants; 3- and 4-pass; 0x01 and 0x80 (Tiger2) pad-initialized |
| xxHash | xxHash-32 and xxHash-64 only |
External Implementations
External implementations of hash and checksum types may not be compatible with all .NET versions. Please see the table below for more information about support.
| Source | Hash / Checksum Types | Notes |
|---|---|---|
| Aaru.Checksums | SpamSum | Some code tweaks made to support older .NET versions |
| Blake3.NET | BLAKE3 | Used in net7.0 and above |
| System.IO.Hashing | XXH3, XXH128 | Used in net462 and above |
| System.Security.Cryptography | MD5, SHA-1, SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-384, SHA3-512, SHAKE128, SHAKE256 | Built-in library; SHA3-256, SHA3-384, SHA3-512, SHAKE128, and SHAKE256 are net8.0 and above only for supported platforms |
Note: If all you care about is performance, I encourage you to forego this library and use the ones listed above directly instead.
Find the link to the Nuget package here.
Description
Releases
15
Languages
C#
97.9%
Shell
1.1%
PowerShell
1%