lslsnips
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lslsnips [2025/12/07 13:03] – [Key2Number] miko | lslsnips [2026/02/24 15:22] (current) – miko | ||
|---|---|---|---|
| Line 50: | Line 50: | ||
| </ | </ | ||
| ===== SL to Telegram ===== | ===== SL to Telegram ===== | ||
| - | < | + | < |
| string TELEGRAM_API_URL = " | string TELEGRAM_API_URL = " | ||
| string chat_id = "< | string chat_id = "< | ||
| Line 81: | Line 81: | ||
| </ | </ | ||
| ===== SL2Discord ===== | ===== SL2Discord ===== | ||
| - | < | + | < |
| string discord_web_hook = " | string discord_web_hook = " | ||
| Line 107: | Line 107: | ||
| </ | </ | ||
| ===== Rezz at feet ==== | ===== Rezz at feet ==== | ||
| - | < | + | < |
| integer canRezAt(vector pos) //can I rez at this place? | integer canRezAt(vector pos) //can I rez at this place? | ||
| { | { | ||
| Line 149: | Line 149: | ||
| </ | </ | ||
| ===== Random giver ===== | ===== Random giver ===== | ||
| - | < | + | < |
| //gimme random | //gimme random | ||
| integer random_integer(integer min, integer max) | integer random_integer(integer min, integer max) | ||
| Line 158: | Line 158: | ||
| </ | </ | ||
| ===== Find in List ===== | ===== Find in List ===== | ||
| - | < | + | < |
| // find stuff in my list or not | // find stuff in my list or not | ||
| Line 294: | Line 294: | ||
| </ | </ | ||
| ===== Binary converter ===== | ===== Binary converter ===== | ||
| - | < | + | < |
| Line 503: | Line 503: | ||
| } | } | ||
| </ | </ | ||
| - | ~~DISCUSSION~~ | + | ===== GetPrimInfo ===== |
| + | < | ||
| + | default | ||
| + | { | ||
| + | touch_start(integer num_detected) | ||
| + | { | ||
| + | integer i; | ||
| + | for(i=0; i< | ||
| + | { | ||
| + | llOwnerSay("/ | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | "\nPos (root): " | ||
| + | "\nRot (root): " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | ===== RealEncryption ===== | ||
| + | < | ||
| + | string xorSalted(string msg, string salt) | ||
| + | { | ||
| + | // Derive a numeric key from the salt | ||
| + | integer key = 0; | ||
| + | integer i; | ||
| + | integer slen = llStringLength(salt); | ||
| + | |||
| + | for (i = 0; i < slen; ++i) | ||
| + | { | ||
| + | key = key ^ llOrd(salt, i); // XOR all salt chars together | ||
| + | key = (key * 31) & 0xFF; // scramble it a bit | ||
| + | } | ||
| + | |||
| + | // Now XOR the message with the salted key | ||
| + | string out = ""; | ||
| + | integer mlen = llStringLength(msg); | ||
| + | |||
| + | for (i = 0; i < mlen; ++i) | ||
| + | { | ||
| + | integer c = llOrd(msg, i); | ||
| + | c = c ^ key; // XOR with salted key | ||
| + | out += llChar(c); | ||
| + | } | ||
| + | |||
| + | return out; | ||
| + | } | ||
| + | </ | ||
| + | 🧪 How to use it | ||
| + | < | ||
| + | string encrypted = xorSalted(" | ||
| + | |||
| + | string decrypted = xorSalted(encrypted, | ||
| + | </ | ||
| + | 🧠 Why this works | ||
| + | The salt is turned into a derived key | ||
| + | * Even a small change in the salt produces a completely different output | ||
| + | * The cipher is reversible only if you know the salt | ||
| + | * It’s compact and fast enough for LSL | ||
| + | * This is the closest you can get to “real” salted encryption inside Second Life scripting. | ||
lslsnips.1765112611.txt.gz · Last modified: by miko
