Compare commits
15 Commits
Author | SHA1 | Date |
---|---|---|
AJ ONeal | 6daa62689d | |
Drew Warren | dca721f8ac | |
Drew Warren | 28ce5450f2 | |
Drew Warren | 3b5f24e02e | |
Drew Warren | 8b87f2848b | |
AJ ONeal | 8c2655d5fa | |
AJ ONeal | 2631d3d0cb | |
AJ ONeal | 413e3a8d5d | |
AJ ONeal | 943d95bc9b | |
AJ ONeal | 781ee7b9b1 | |
AJ ONeal | a05aed1495 | |
AJ ONeal | cdb4aa97d0 | |
AJ ONeal | 700e4a375d | |
AJ ONeal | d28f7122c3 | |
AJ ONeal | 13f8b90523 |
50
README.md
50
README.md
|
@ -16,26 +16,40 @@ look at twice (nor telling someone else twice).
|
|||
I should be able to shout one of these ids across the room to a co-worker
|
||||
or spouse and have them be able to enter it without any confusion.
|
||||
|
||||
Currently the id space is about 100,000 ids (100 * 100 * 100).
|
||||
Currently the id space is about 1,000,000 ids (100 * 100 * 100).
|
||||
|
||||
The goal is to have several billion possible combinations by adding
|
||||
more words as well as expanding the ids to have verbs and adverbs.
|
||||
|
||||
For a larger address space now, consider:
|
||||
|
||||
* Human Readable IDs for Node.js and Browser: <https://github.com/linus/greg/>
|
||||
* Human Readable IDs for Java: <https://github.com/PerWiklander/IdentifierSentence>
|
||||
* Human Readable IDs for Python: <https://gist.github.com/4447660>
|
||||
|
||||
All of these also have the benefit of bi-directional conversion, but not all of them
|
||||
have words which are easy to pronounce and spell.
|
||||
|
||||
Usage
|
||||
=======
|
||||
|
||||
### npm
|
||||
|
||||
```bash
|
||||
# from npm
|
||||
npm install --save human-readable-ids
|
||||
```
|
||||
|
||||
```bash
|
||||
# directly from git
|
||||
npm install --save https://git.coolaj86.com/coolaj86/human-readable-ids.js.git
|
||||
```
|
||||
|
||||
```javascript
|
||||
'use strict';
|
||||
|
||||
var hri = require('human-readable-ids').hri
|
||||
, i
|
||||
;
|
||||
var hri = require('human-readable-ids').hri;
|
||||
var i;
|
||||
|
||||
// generate 100 random ids
|
||||
for (i = 0; i < 100; i += 1) {
|
||||
|
@ -49,15 +63,6 @@ for (i = 0; i < 100; i += 1) {
|
|||
bower install --save human-readable-ids
|
||||
```
|
||||
|
||||
```jade
|
||||
html
|
||||
head
|
||||
script(src="bower_components/knuth-shuffle/index.js")
|
||||
script(src="bower_components/human-readable-ids/assets/animals.js")
|
||||
script(src="bower_components/human-readable-ids/assets/adjectives.js")
|
||||
script(src="bower_components/human-readable-ids/index.js")
|
||||
```
|
||||
|
||||
```html
|
||||
<script src="bower_components/knuth-shuffle/index.js"></script>
|
||||
<script src="bower_components/human-readable-ids/assets/animals.js"></script>
|
||||
|
@ -69,9 +74,8 @@ html
|
|||
;(function (exports) {
|
||||
'use strict';
|
||||
|
||||
var hri = exports.humanReadableIds || require('human-readable-ids').hri
|
||||
, i
|
||||
;
|
||||
var hri = exports.humanReadableIds || require('human-readable-ids').hri;
|
||||
var i;
|
||||
|
||||
for (i = 0; i < 100; i += 1) {
|
||||
console.log(hri.random());
|
||||
|
@ -99,6 +103,20 @@ The pre-publish script outputs the formatted javascript.
|
|||
* grey, gray, bore, boar (two ways of spelling the same word or sound)
|
||||
* prawn (not well-known)
|
||||
|
||||
Resources
|
||||
=========
|
||||
|
||||
Add more words and strategies from
|
||||
|
||||
* <http://blog.asana.com/2011/09/6-sad-squid-snuggle-softly/>
|
||||
* The Dolch List <http://www.mrsperkins.com/dolch-words-all.html>
|
||||
* <http://simple.wikipedia.org/wiki/Wikipedia:Basic_English_alphabetical_wordlist>
|
||||
* <https://github.com/zacharyvoase/humanhash>
|
||||
* <https://gist.github.com/ucnv/1121015>
|
||||
* <https://gist.github.com/vikhyat/105610>
|
||||
* <http://simple.wikipedia.org/wiki/Wikipedia:List_of_1000_basic_words>
|
||||
* <http://grammar.yourdictionary.com/parts-of-speech/adverbs/list-of-100-adverbs.html>
|
||||
|
||||
TODO
|
||||
====
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "human-readable-ids",
|
||||
"main": "index.js",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.3",
|
||||
"homepage": "https://github.com/coolaj86/human-readable-ids-js",
|
||||
"authors": [
|
||||
"AJ ONeal <awesome@coolaj86.com>"
|
||||
|
|
14
package.json
14
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "human-readable-ids",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.4",
|
||||
"description": "Generate human-readable ids from lists of easy-to-spell nouns and adjectives",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
|
@ -8,12 +8,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"test": "node tests/run-in-node.js"
|
||||
, "prepublish": "node src/generate-lists"
|
||||
"test": "node tests/run-in-node.js",
|
||||
"prepublish": "node src/generate-lists"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/coolaj86/human-readable-ids-js.git"
|
||||
"url": "https://git.coolaj86.com/coolaj86/human-readable-ids.js.git"
|
||||
},
|
||||
"keywords": [
|
||||
"hri",
|
||||
|
@ -27,10 +27,10 @@
|
|||
"nouns",
|
||||
"adjectives"
|
||||
],
|
||||
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.com/)",
|
||||
"author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
|
||||
"license": "Apache2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/coolaj86/human-readable-ids-js/issues"
|
||||
"url": "https://git.coolaj86.com/coolaj86/human-readable-ids.js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/coolaj86/human-readable-ids-js"
|
||||
"homepage": "https://git.coolaj86.com/coolaj86/human-readable-ids.js#readme"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue