Skip to content
lsl.devlsl.devLSL Dev

llComputeHash

function
Function syntax
string llComputeHash(
  1. string message,// Message string to be hashed.
  2. string algorithm// Cryptographic digest algorithm to use (e.g., md5, sha1, sha224, sha256, sha384, or sha512).
);
Returns
string
Energy
10

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

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

How to use
string result = llComputeHash("", "");
Example 1
18 collapsed lines
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);
}
}
}
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from LlComputeHash, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.