love.data.hash

Available since LÖVE 0.11.0
This function is not supported in earlier versions.

Compute the message digest of string using specified hash algorithm.

Function

Synopsis

rawdigest = love.data.hash( hashFunction, string )

Arguments

HashFunction hashFunction
Hash algorithm to use.
string string
String to hash.

Returns

string rawdigest
Raw message digest string.

Function

Synopsis

rawdigest = love.data.hash( hashFunction, data )

Arguments

HashFunction hashFunction
Hash algorithm to use.
Data data
Data to hash.

Returns

string rawdigest
Raw message digest string.

Notes

To return the hex string representation of the hash, use love.data.encode

hexDigestString = love.data.encode("string", "hex", love.data.hash(algo, data))

See Also

Other Languages