Available since LÖVE 11.0 |
This function is not supported in earlier versions. |
Compute the message digest of a string using a specified hash algorithm.
![]() |
There's bug in version, up to 11.2 which gives wrong result for very-specific input length (112 + 128n for SHA512 and SHA384, 56 + 64n for other hash functions). |
rawdigest = love.data.hash( hashFunction, string )
HashFunction hashFunction
string string
string rawdigest
rawdigest = love.data.hash( hashFunction, data )
HashFunction hashFunction
Data data
string rawdigest
To return the hex string representation of the hash, use love.data.encode
hexDigestString = love.data.encode("string", "hex", love.data.hash(algo, data))