<br />
<b>Warning</b>:  Parameter 1 to Language::getMagic() expected to be a reference, value given in <b>/sda/2/c/digigrids/wiki/includes/StubObject.php</b> on line <b>58</b><br />
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://digigrids.free.fr/wiki/skins//common/feed.css?207"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>http://digigrids.free.fr/wiki/index.php?action=history&amp;feed=atom&amp;title=StringIsValidKey</id>
		<title>StringIsValidKey - Historique des versions</title>
		<link rel="self" type="application/atom+xml" href="http://digigrids.free.fr/wiki/index.php?action=history&amp;feed=atom&amp;title=StringIsValidKey"/>
		<link rel="alternate" type="text/html" href="http://digigrids.free.fr/wiki/index.php?title=StringIsValidKey&amp;action=history"/>
		<updated>2026-09-02T15:44:11Z</updated>
		<subtitle>Historique pour cette page sur le wiki</subtitle>
		<generator>MediaWiki 1.15.1</generator>

﻿	<entry>
		<id>http://digigrids.free.fr/wiki/index.php?title=StringIsValidKey&amp;diff=5985&amp;oldid=prev</id>
		<title>Djphil le 13 octobre 2012 à 22:25</title>
		<link rel="alternate" type="text/html" href="http://digigrids.free.fr/wiki/index.php?title=StringIsValidKey&amp;diff=5985&amp;oldid=prev"/>
				<updated>2012-10-13T22:25:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Version précédente&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Version du 13 octobre 2012 à 22:25&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 40 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 40 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c == &amp;quot;5&amp;quot; || c == &amp;quot;6&amp;quot; || c == &amp;quot;7&amp;quot; || c == &amp;quot;8&amp;quot; || c == &amp;quot;9&amp;quot; ||&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c == &amp;quot;5&amp;quot; || c == &amp;quot;6&amp;quot; || c == &amp;quot;7&amp;quot; || c == &amp;quot;8&amp;quot; || c == &amp;quot;9&amp;quot; ||&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c == &amp;quot;a&amp;quot; || c == &amp;quot;b&amp;quot; || c == &amp;quot;c&amp;quot; || c == &amp;quot;d&amp;quot; || c == &amp;quot;e&amp;quot; ||&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c == &amp;quot;a&amp;quot; || c == &amp;quot;b&amp;quot; || c == &amp;quot;c&amp;quot; || c == &amp;quot;d&amp;quot; || c == &amp;quot;e&amp;quot; ||&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c == &amp;quot;f&amp;quot;) { integer value = TRUE; } //Do something. Keeps the compiler happy.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c == &amp;quot;f&amp;quot;) { integer value = TRUE; } // Do something. Keeps the compiler happy.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else return FALSE; //Does not contain a hex character&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else return FALSE; // Does not contain a hex character&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; return TRUE; //Must be a key.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; return TRUE; // Must be a key.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;//Code to check messages typed on all chat by yourself only, if they are a key.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// Code to check messages typed on all chat by yourself only, if they are a key.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;default&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;default&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-09-02 15:44:11 --&gt;
&lt;/table&gt;</summary>
		<author><name>Djphil</name></author>	</entry>

	<entry>
		<id>http://digigrids.free.fr/wiki/index.php?title=StringIsValidKey&amp;diff=4647&amp;oldid=prev</id>
		<title>Djphil&amp;nbsp;:&amp;#32;Page créée avec « This User Made Function can be used to identify if a given string is a valid Second Life UUID Key. It is to be used as a Boolean function which will return TRUE if th… »</title>
		<link rel="alternate" type="text/html" href="http://digigrids.free.fr/wiki/index.php?title=StringIsValidKey&amp;diff=4647&amp;oldid=prev"/>
				<updated>2012-04-27T00:00:28Z</updated>
		
		<summary type="html">&lt;p&gt;Page créée avec « This User Made Function can be used to identify if a given string is a valid Second Life UUID &lt;a href=&quot;/wiki/index.php?title=Key&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Key (page inexistante)&quot;&gt;Key&lt;/a&gt;. It is to be used as a Boolean function which will return TRUE if th… »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This User Made Function can be used to identify if a given string is a valid Second Life UUID [[key|Key]]. It is to be used as a Boolean function which will return TRUE if the string is a valid key, and return FALSE if it is not.&amp;lt;br&amp;gt;&lt;br /&gt;
'''It will not check if the key given actually references an asset, agent/group, instance, or terrain).''' ''Checks with other functions and the given key can be used for this.''&lt;br /&gt;
&lt;br /&gt;
By definition, a key consists of the 16 hexadecimal characters: 0-9 and a-f. Unlike other Keys, the alphabetical characters are always lowercase.&lt;br /&gt;
&lt;br /&gt;
The process of the function is to test the string using various methods. The first method is to compile the string into a list, using the hyphen (-) as a separator. A key that has been parsed into a list, will have 5 indices. These are of specific lengths, and the function checks these, causing it to fail if one of the lengths are not correct.&lt;br /&gt;
&lt;br /&gt;
If all string segments are of the correct length, it then checks the characters in each segment, failing if a character is not one of the 16 hexadecimal characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer StringIsValidKey(string input)&lt;br /&gt;
{&lt;br /&gt;
    //Split the given message into a list, using hyphens as separators.&lt;br /&gt;
    list keySegments = llParseString2List(input, [&amp;quot;-&amp;quot;], [&amp;quot;&amp;quot;]);&lt;br /&gt;
&lt;br /&gt;
    //Get the number of indices in the list.&lt;br /&gt;
    integer length = llGetListLength(keySegments);&lt;br /&gt;
    &lt;br /&gt;
    if(length != 5) return FALSE; //Keys are 5 segments seperated by hyphens (-)&lt;br /&gt;
    &lt;br /&gt;
    //Declare a few variables for use later.&lt;br /&gt;
    integer i;  integer j;  integer segLength;  string segment;&lt;br /&gt;
&lt;br /&gt;
    //Start a for loop for each segment in the list. This for loop will execute 5 times.&lt;br /&gt;
    for(i = 0; i &amp;lt; length; i++) {&lt;br /&gt;
        //Assign the string and integer variables with values pertaining to the segment.&lt;br /&gt;
        segment = llList2String(keySegments, i);&lt;br /&gt;
        segLength = llStringLength(segment);&lt;br /&gt;
        &lt;br /&gt;
        if(i == 0 &amp;amp;&amp;amp; segLength != 8) return FALSE; //Segment 1 must be 8 characters&lt;br /&gt;
        if((i &amp;gt; 0 &amp;amp;&amp;amp; i &amp;lt; 4) &amp;amp;&amp;amp; segLength != 4) return FALSE; //Segments 2-4 must be 4 characters&lt;br /&gt;
        if(i == 4 &amp;amp;&amp;amp; segLength != 12) return FALSE; //Segment 5 must be 12 characters&lt;br /&gt;
        &lt;br /&gt;
        //Start a for loop checking each character in the segment. This for loop will execute a maximum of 12 times and minimum of 4 times.&lt;br /&gt;
        for(j = 0; j &amp;lt; segLength; j++) {&lt;br /&gt;
            string c = llGetSubString(segment, j, j);&lt;br /&gt;
            &lt;br /&gt;
            //Compare each character in the current segment if they match one of the characters below.&lt;br /&gt;
            if(c == &amp;quot;0&amp;quot; || c == &amp;quot;1&amp;quot; || c == &amp;quot;2&amp;quot; || c == &amp;quot;3&amp;quot; || c == &amp;quot;4&amp;quot; ||&lt;br /&gt;
               c == &amp;quot;5&amp;quot; || c == &amp;quot;6&amp;quot; || c == &amp;quot;7&amp;quot; || c == &amp;quot;8&amp;quot; || c == &amp;quot;9&amp;quot; ||&lt;br /&gt;
               c == &amp;quot;a&amp;quot; || c == &amp;quot;b&amp;quot; || c == &amp;quot;c&amp;quot; || c == &amp;quot;d&amp;quot; || c == &amp;quot;e&amp;quot; ||&lt;br /&gt;
               c == &amp;quot;f&amp;quot;) { integer value = TRUE; } //Do something. Keeps the compiler happy.&lt;br /&gt;
               &lt;br /&gt;
            else return FALSE; //Does not contain a hex character&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return TRUE; //Must be a key.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//Code to check messages typed on all chat by yourself only, if they are a key.&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llListen(0, &amp;quot;&amp;quot;, llGetOwner(), &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if(StringIsValidKey(message)) llOwnerSay(message + &amp;quot; is a valid key.&amp;quot;);&lt;br /&gt;
        else if(!StringIsValidKey(message)) llOwnerSay(message + &amp;quot; is NOT a valid key!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djphil</name></author>	</entry>

	</feed>