Module jls.util.MessageDigest

Provide MessageDigest class.

Class MessageDigest

MessageDigest:new (alg) Creates a new MessageDigest.
messageDigest:reset () Resets this MessageDigest.
messageDigest:update (m) Updates the digest using the specified string.
messageDigest:finish ([m]) Completes and returns the digest.
messageDigest:digest (m) Returns the digest using the specified string.


Class MessageDigest

The MessageDigest class. The MessageDigest class provides access to algorithms that compute message digest or hash from any string or message.
MessageDigest:new (alg)
Creates a new MessageDigest.

Parameters:

  • alg string The name of the algorithm.

Returns:

    a new MessageDigest

Usage:

    local md = MessageDigest:new('md5')
    md:digest('The quick brown fox jumps over the lazy dog')
messageDigest:reset ()
Resets this MessageDigest.
messageDigest:update (m)
Updates the digest using the specified string.

Parameters:

  • m string a message to update the digest.
messageDigest:finish ([m])
Completes and returns the digest.

Parameters:

  • m string a message to update the digest. (optional)

Returns:

    string the message digest result.
messageDigest:digest (m)
Returns the digest using the specified string.

Parameters:

  • m string a message to compute the digest.

Returns:

    string the message digest result.
generated by LDoc 1.4.6 Last updated 2022-01-22 16:32:56