Namespace LrDigest
This namespace provides the following hashing factories: LrDigest.SHA256 and LrDigest.SHA512
Access the factories directly from the imported namespace.
First supported in version 4.0 of the Lightroom SDK.
This API changed in Lightroom 5.0: the :digest method now also resets the digester.
New change in Lightroom 13.5: LrDigest.MD4, LrDigest.MD5 and LrDigest.SHA1 are now deprecated and may be removed in a future update.
Summary
Factory.digest( input, digest_name, key )
Quick digest a string
Create a new digester instance
LrDigest.HMAC.init( digest_name, key )
Construct a HMAC digest
Compute the current digest for the digester
Clear a digester making ready for reuse
digester:update( str )
Add new data to a digester
Functions
- Factory.digest( input, digest_name, key )
-
Quick digest a string
Parameters
- 1. input
- (string) Add the input string to the ongoing digest
- 2. digest_name
- (string) one of the digests support in this namespace: "SHA256" or "SHA512". Only used for HMAC.
- 3. key
- (string) the key for HMAC. Only used for HMAC.
Return values
- digestHex (string) The digest, as a hex string
- digestBin (string) The digest, as a binary data string.
- Factory.init()
-
Create a new digester instance
Return value
digester (digester) The new digester - LrDigest.HMAC.init( digest_name, key )
-
Construct a HMAC digest
Parameters
- 1. digest_name
- (string) one of the digests support in this namespace: "SHA256" or "SHA512"
- 2. key
- (string) the key for HMAC
Return value
digester (digester) The new digester, or nil if params are invalid - digester:digest()
-
Compute the current digest for the digester
Return values
- digestHex (string) The digest, as a hex string
- digestBin (string) The digest, as a binary data string
- digester:reset()
- Clear a digester making ready for reuse
- digester:update( str )
-
Add new data to a digester
Parameters
- 1. str
- (string) Add the input string to the ongoing digest