Difference between revisions of "LlComputeHash"

From Second Life Wiki
Jump to navigation Jump to search
(Add llComputeHash() which is included in Gingerbread server update scheduled for late Jan or early Feb 2024.)
 
(No difference)

Latest revision as of 22:51, 17 January 2024

Summary

Function: string llComputeHash( string message, string algorithm );

Returns a string hex-encoded hash digest of message using cryptographic algorithm

• string message
• string algorithm

Supported values of algorithm are md5, md5_sha1, sha1, sha224, sha256, sha384, sha512.

Examples

default
{
    state_entry()
    {
        llOwnerSay("Ready");
    }

    touch_start(integer touch_count)
    {
        string message = "your-test-message-here";

        list algorithms = ["md5", "md5_sha1", "sha1", "sha224", "sha256", "sha384", "sha512" ];
        
        integer num_algorithms = llGetListLength(algorithms);
        llOwnerSay("message='" + message + "'");
        
        integer i = 0;
        for (i = 0; i < num_algorithms; ++i)
        {
            string algorithm = llList2String(algorithms, i);
            string hash = llComputeHash(message, algorithm);
            llOwnerSay(algorithm + " : " + hash);
        }
    }
}

See Also

Functions

•  llSignRSA
•  llVerifyRSA
•  llHMAC
•  llSHA1String
•  llSHA256String
•  llMD5String

Deep Notes

Search JIRA for related Issues

Signature

function string llComputeHash( string message, string algorithm );