CRC32 is calculated as uint32
, while HashAlgorithm
in .NET by convention returns byte[]
. I can, of course, easily convert it with bytes = BitConverter.GetBytes(hash)
but this is affected by "endianness" of a system (almost no chance for big-endian, of course).
Anyway, I've been thinking is there any convention to follow? I have a feeling that it should be big-endian to make hash.ToString("X")
and bytes.ToHex()
(assuming .ToHex()
exists) look the same.
I've checked https://github.com/vurdalakov/crc32/wiki/CRC32 and it does not do that. Any thoughts?