-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
45 lines (45 loc) · 2.11 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"name": "hat",
"version": "0.0.3",
"description": "generate random IDs and avoid collisions",
"main": "index.js",
"directories": {
"lib": ".",
"example": "example",
"test": "test"
},
"devDependencies": {
"expresso": "0.7.x"
},
"scripts": {
"test": "expresso"
},
"repository": {
"type": "git",
"url": "http://github.com/substack/node-hat.git"
},
"keywords": [
"id",
"uid",
"uuid",
"random",
"hat",
"rack",
"unique"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"license": "MIT/X11",
"engine": {
"node": ">=0.4"
},
"readme": "hat\n===\n\nGenerate random IDs and avoid collisions.\n\n![hat](http://substack.net/images/hat.png)\n\nexamples\n========\n\nhat\n---\n\n````javascript\nvar hat = require('hat');\n\nvar id = hat();\nconsole.log(id);\n````\n\noutput:\n\n````\n0c82a54f22f775a3ed8b97b2dea74036\n````\n\nrack\n----\n\n````javascript\nvar hat = require('hat');\nvar rack = hat.rack();\n\nconsole.log(rack());\nconsole.log(rack());\n````\n\noutput:\n\n````\n1c24171393dc5de04ffcb21f1182ab28\nfabe2323acc1b559dee43d4a1e16cbeb\n````\n\nmethods\n=======\n\nvar hat = require('hat');\n\nhat(bits=128, base=16)\n----------------------\n\nGenerate a random ID string with `bits` of data in a `base`.\n\nLeading zeros are appended such that all outputs for a given number of bits have\nequal length.\n\nvar rack = hat.rack(bits=128, base=16, expandBy)\n------------------------------------------------\n\nMake a new hat rack. Call `rack()` repeatedly to generate new IDs which are\nchecked for collisions.\n\nIf `expandBy` is specified, increment `bits` by this amount if too many\ncollisions occur. If `expandBy` isn't specified, `rack()` will throw if too many\ncollisions occur during generation.\n\nOptionally call `var id = rack(data)` to store `data` at the new ID.\n\nYou can get the data out again with `rack.get(id)` and set the data with\n`rack.set(id, value)`.\n",
"_id": "hat@0.0.3",
"dist": {
"shasum": "9af2926114d0a03a454746d15e56eecaa4745085"
},
"_from": "hat@*"
}