Cryptography

Frends.Cryptography.GenerateHash / 2.0.0

Summary

Computes a digest of a string with a chosen algorithm, keyed or unkeyed, returning it in text form. A keyed hash authenticates the sender as well as detecting change; an unkeyed one only detects change.

Typical use — checksums over payloads in transit, and the signature step for APIs that authenticate requests with a shared secret

Details

Frends version
5.7 and newer
Agent
Crossplatform
Target framework
net8.0

Input parameters.

Name Type Default Example Description
HashFunction Function MD5 MD5

Generates input string to chosen HashAlgorithm type.

Possible values:

  • MD5: Generates input string to chosen HashAlgorithm type.

  • SHA1: Generates input string to chosen HashAlgorithm type.

  • SHA256: Generates input string to chosen HashAlgorithm type.

  • SHA384: Generates input string to chosen HashAlgorithm type.

  • SHA512: Generates input string to chosen HashAlgorithm type.

  • HMACSHA256: Generates input string to chosen HashAlgorithm type.

  • HMACSHA512: Generates input string to chosen HashAlgorithm type.

InputString String foo

Input string to be hashed.

HashKeySecret String foobar

HashKey when using HMACSHA256 or HMACSHA512 HashAlgorithm type.

An unhandled error has occurred. Reload 🗙