diff options
author | Rogan Creswick <creswick@gmail.com> | 2013-01-02 14:56:40 -0800 |
---|---|---|
committer | Rogan Creswick <creswick@gmail.com> | 2013-01-02 14:56:40 -0800 |
commit | 75139375b76cb277546da2429d8e983ca6758f61 (patch) | |
tree | 5b8d180f5f6dc9809eeec1612726a1de36cb7365 /tools/addon-sdk-1.7/packages/api-utils/docs/uuid.md | |
parent | dbf076b39ca655500f2c0546b0ea57ceffca33b3 (diff) |
added addon-sdk-1.7, without any changes
Diffstat (limited to 'tools/addon-sdk-1.7/packages/api-utils/docs/uuid.md')
-rw-r--r-- | tools/addon-sdk-1.7/packages/api-utils/docs/uuid.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/addon-sdk-1.7/packages/api-utils/docs/uuid.md b/tools/addon-sdk-1.7/packages/api-utils/docs/uuid.md new file mode 100644 index 0000000..429e3a0 --- /dev/null +++ b/tools/addon-sdk-1.7/packages/api-utils/docs/uuid.md @@ -0,0 +1,27 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> + +Module `uuid` provides low level API for generating / parsing UUID, that may +be necessary when hacking on internals of the platform. + + +## Generate UUID + +Module exports `uuid` function. When called without arguments it will uses +platform-specific methods to obtain a `nsID` that can be considered to be +globally unique. + + let uuid = require('api-utils/uuid').uuid() + +## Parsing UUID + +Sometimes one might need to create `nsID` from an existing UUID string. Same +`uuid` function may be used to parse such UUID strings into an `nsID`: + + let { uuid } = require('api-utils/uuid'); + let firefoxUUID = uuid('{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'); + +For more details about UUID representations and what they are used for by the +platform see MDN documentation for +[JSID](https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIJSID) |