Skip to content

libsodium.GenericHashDigest

Andrew Lambert edited this page Nov 26, 2022 · 13 revisions

libsodium.GenericHashDigest

Class Declaration

 Protected Class GenericHashDigest

Remarks

This class computes a fixed-length fingerprint for an arbitrarily long message. Usage is similar to the built-in MD5Digest class but uses the much faster and more secure BLAKE2b algorithm. You may optionally use a secret key when hashing the data (i.e. HMAC).

This class also supports keyed and un-keyed SHA256 and SHA512 digestion.

Caution

This class is not suitable for password hashing or password-based key derivation. Use the Password class instead.

Methods

Properties

Shared methods

Example

This example computes the SHA512 hash of the string Hello, world!.

  Dim digest As New libsodium.GenericHashDigest(libsodium.HashType.SHA512)
  digest.Process("Hello, ")
  digest.Process("world!")
  Dim hash As String = digest.Value

See also

Clone this wiki locally