Skip to content

Hash a byte payload

Compute an MD5 hash of a byte payload, triggered when caller needs a content fingerprint.

Field Value
Operation ID OP-025
Trigger Caller needs a content fingerprint
Inputs input
Outputs Byte[] MD5 digest
Primary components ByteExtensions.GetMD5Hash(this Byte[] input)
Entry point Common/SAIF.Common/Extensions/ByteExtensions.cs

Steps

  1. Create an MD5 instance inside a using block (MD5.Create()). (BR-057)
  2. Compute and return md5.ComputeHash(input); the algorithm instance is disposed on scope exit. (BR-057)

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start(["Caller needs a content<br>fingerprint"]) --> S1["Create MD5 instance<br>inside using block"]
    S1 --> S2["Compute md5.ComputeHash(input)"]
    S2 --> S3["Dispose MD5 instance<br>on scope exit"]
    S3 --> End([Return MD5 digest bytes])

Sources

  • Common/SAIF.Common/Extensions/ByteExtensions.cs