string llHMAC( string private_key, string msg, string algorithm );
Forced delay: 0.0 seconds. Energy: 10.0.
This function supports md5, sha1, sha224, sha256, sha384, sha512 for algorithm.
Returns a string that is the Base64-encoded HMAC hash of msg when using hash algorithm algorithm and secret key private_key.
default
{
state_entry()
{
string private_key = "secret key";
// Supported algorithims for llHMAC() include:
// md5, sha1, sha224, sha256, sha384, sha512
string algorithm = "sha1";
string msg = "Hello, Avatar!";
string digest = llHMAC(private_key, msg, algorithm);
// For the given private_key/msg/algorithm, expect the HMAC
// digest to be 'ffCDntkagRO5mIEtd2tYzM2Bg8I='
llSay(0, "HMAC digest of message '" + msg + "' using algorithm "
+ algorithm + " is " + digest);
}
}