Class RedbMd5

Namespace: redb.Core.Utils
Assembly: redb.Core.dll

MD5 entry point for REDB hashing.

REDB stores hashes as (exactly 16 bytes) in the database, so the algorithm
itself cannot change without invalidating every existing database. It stays MD5 — this type only
decides WHICH implementation computes it.


On server platforms nothing changes: the call goes straight to , exactly
as before. The managed fallback exists for browser-wasm (Blazor WebAssembly), where the
runtime ships no MD5 provider and throws
CryptographicException: Cryptography_UnknownHashAlgorithm, MD5 — which used to break
SyncScheme and Save outright.


The fallback is bit-for-bit identical to the system implementation (RFC 1321); this is asserted by
unit tests comparing both over RFC test vectors, block boundaries and random buffers. Hashes
written by a browser and by a server are therefore interchangeable.

public static class RedbMd5

Inheritance

Object→RedbMd5

Properties

UseManagedImplementation

True when the platform has no usable MD5 provider and the managed implementation must be used.

public static bool UseManagedImplementation { get; }

Methods

ComputeHash(byte[])

Compute the MD5 digest of data (16 bytes).

public static byte[] ComputeHash(byte[] data)

ComputeHashManaged(byte[])

Managed MD5 per RFC 1321. Produces the same 16 bytes as the platform implementation.

public static byte[] ComputeHashManaged(byte[] data)