Skip to content

Instantly share code, notes, and snippets.

@sl-service-account
Created January 23, 2024 22:52
Show Gist options
  • Save sl-service-account/61a9cd3e01009c6d2bca30092a20b54f to your computer and use it in GitHub Desktop.
Save sl-service-account/61a9cd3e01009c6d2bca30092a20b54f to your computer and use it in GitHub Desktop.
Demonstration of using the new llComputeHash method in LSL
default {
touch_start(integer count) {
string message = "your-test-message-here";
list algorithms = ["md5", "md5_sha1", "sha1", "sha224", "sha256", "sha384", "sha512"];
integer algorithmCount = llGetListLength(algorithms);
llOwnerSay("message='" + message + "'");
integer i = 0;
for (i = 0; i < algorithmCount; ++i) {
string algorithm = llList2String(algorithms, i);
string hash = llComputeHash(message, algorithm);
llOwnerSay(algorithm + "=" + hash);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment