Description of MUSHclient world function: world.GetUniqueID
||Creates a unique ID for general use, or for making Plugin IDs
View list of data type meanings
This uses CreateGUID to get a unique number, and then hashes it, retaining 24 characters (96 bits) of the hash. This generates a nice, unique identifier, like this: "0a96ce42d8e0ede554d3b9ab".
The advantage of using this over CreateGUID is that by hashing the number your network card MAC address is concealed. Conceivably some users might not want their MAC address to be revealed. The number generated here will be used by plugins to uniquely identify themselves.
You could also use it for variable, trigger, timer, alias names, when generated by a script, to ensure uniqueness over multiple sessions. You could also use it as a handy "password generator", as the number sequences are hardly going to be predicable.
Contrast this to "GetUniqueNumber" which only returns a unique number for this session of MUSHclient. Thus, the numbers (from "GetUniqueNumber") will not be unique over multiple sessions.
See also the new script function world.CreateGUID.
Also, using random number generation for unique identifiers has a chance of returning the same number, depending on a) the seed given to the generator; and b) the way the generator must eventually recyle and regenerate the same sequence.
Note: Available in version 3.23 onwards.
world.Note (world.GetUniqueID ());
$world->Note ($world->GetUniqueID ());
world.Note (world.GetUniqueID )
Note (GetUniqueID ())
A 24-character unique identifier.
|Introduced in version
See also ...
||Creates a GUID - Global Unique Identifier
||Returns a unique number
||Produces a hash (checksum) of a specified piece of text
Search for script function
Enter a word or phrase in the box below to narrow the list down to those that match.
The function name, prototype, summary, and description are searched.
Leave blank to show all functions.
Many functions return a "code" which indicates the success or otherwise
of the function.
view a list of the return codes
The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).
view a list of the data types used in function prototypes
View all functions
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )