| Name | GetUniqueID |
|---|---|
| Type | Method |
| Summary | Creates a unique ID for general use, or for making Plugin IDs |
| Prototype | BSTR GetUniqueID(); |
| Description | 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 MUSHclient version 3.23 onwards. |
| VBscript example | |
| Jscript example | |
| PerlScript example | |
| Returns | A 24-character unique identifier. |
See also ...