/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // /////////////////////////////////////////////////////////////////////////// list wasReversePermuteListElements(list input, integer times) { if(times == 0) return input; return wasReversePermuteListElements( llList2List(input, 1, -1) + llList2String(input, 0), --times ); } /////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // /////////////////////////////////////////////////////////////////////////// integer wasIsUpper(string a) { if(a == "") return FALSE; integer x = llBase64ToInteger("AAAA" + llStringToBase64(llGetSubString(a, 0, 0))); return x >= 65 && x <= 90; } /////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // /////////////////////////////////////////////////////////////////////////// integer wasIsAlpha(string a) { if(a == "") return FALSE; integer x = llBase64ToInteger("AAAA" + llStringToBase64(llGetSubString(a, 0, 0))); return (x >= 65 && x <= 90) || (x >= 97 && x <= 122); } /////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // /////////////////////////////////////////////////////////////////////////// string wasVIGENEREExpandKey(string input, string enc_key) { // expand the key string exp_key = ""; integer i = 0; integer j = 0; do { string p = llGetSubString(input, i, i); if(!wasIsAlpha(p)) { exp_key += p; jump continue; } integer m = j % llStringLength(enc_key); exp_key += llGetSubString(enc_key, m, m); ++j; @continue; ++i; } while(i