Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6daa62689d | ||
|
|
dca721f8ac | ||
|
|
28ce5450f2 | ||
|
|
3b5f24e02e | ||
|
|
8b87f2848b | ||
|
|
8c2655d5fa | ||
|
|
2631d3d0cb | ||
|
|
413e3a8d5d | ||
|
|
943d95bc9b | ||
|
|
781ee7b9b1 | ||
|
|
a05aed1495 | ||
|
|
cdb4aa97d0 | ||
|
|
700e4a375d | ||
|
|
d28f7122c3 | ||
|
|
13f8b90523 | ||
|
|
73d11a3ecd | ||
|
|
9929c3a6e1 |
81
README.md
81
README.md
@ -11,25 +11,78 @@ Generate ids in the format of `adjective-noun-#` such as
|
|||||||
* brave-ladybug-90
|
* brave-ladybug-90
|
||||||
|
|
||||||
My problem is that I often want ids that I can type without having to
|
My problem is that I often want ids that I can type without having to
|
||||||
look at it twice (nor telling someone else twice).
|
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
|
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 in without any confusion.
|
or spouse and have them be able to enter it without any confusion.
|
||||||
|
|
||||||
Currently the id space is aboutt 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.
|
|
||||||
|
|
||||||
Install
|
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
|
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;
|
||||||
|
var i;
|
||||||
|
|
||||||
|
// generate 100 random ids
|
||||||
|
for (i = 0; i < 100; i += 1) {
|
||||||
|
console.log(hri.random());
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### bower / browser
|
||||||
|
|
||||||
```
|
```
|
||||||
bower install --save human-readable-ids
|
bower install --save human-readable-ids
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="bower_components/knuth-shuffle/index.js"></script>
|
||||||
|
<script src="bower_components/human-readable-ids/assets/animals.js"></script>
|
||||||
|
<script src="bower_components/human-readable-ids/assets/adjectives.js"></script>
|
||||||
|
<script src="bower_components/human-readable-ids/index.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
;(function (exports) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var hri = exports.humanReadableIds || require('human-readable-ids').hri;
|
||||||
|
var i;
|
||||||
|
|
||||||
|
for (i = 0; i < 100; i += 1) {
|
||||||
|
console.log(hri.random());
|
||||||
|
}
|
||||||
|
}('undefined' !== typeof exports && exports || new Function('return this')()));
|
||||||
|
```
|
||||||
|
|
||||||
Contributing
|
Contributing
|
||||||
============
|
============
|
||||||
|
|
||||||
@ -50,6 +103,20 @@ The pre-publish script outputs the formatted javascript.
|
|||||||
* grey, gray, bore, boar (two ways of spelling the same word or sound)
|
* grey, gray, bore, boar (two ways of spelling the same word or sound)
|
||||||
* prawn (not well-known)
|
* 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
|
TODO
|
||||||
====
|
====
|
||||||
|
|
||||||
@ -57,6 +124,8 @@ Acheive 1 trillion ids with a combination such as
|
|||||||
|
|
||||||
`number adjective noun verb adverb`
|
`number adjective noun verb adverb`
|
||||||
|
|
||||||
|
`42-red-foxes-run-quickly`
|
||||||
|
|
||||||
And allow choosing various formats based on the desired
|
And allow choosing various formats based on the desired
|
||||||
number of ids.
|
number of ids.
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "human-readable-ids",
|
"name": "human-readable-ids",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"version": "1.0.0",
|
"version": "1.0.3",
|
||||||
"homepage": "https://github.com/coolaj86/human-readable-ids-js",
|
"homepage": "https://github.com/coolaj86/human-readable-ids-js",
|
||||||
"authors": [
|
"authors": [
|
||||||
"AJ ONeal <awesome@coolaj86.com>"
|
"AJ ONeal <awesome@coolaj86.com>"
|
||||||
|
|||||||
14
package.json
14
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "human-readable-ids",
|
"name": "human-readable-ids",
|
||||||
"version": "1.0.0",
|
"version": "1.0.4",
|
||||||
"description": "Generate human-readable ids from lists of easy-to-spell nouns and adjectives",
|
"description": "Generate human-readable ids from lists of easy-to-spell nouns and adjectives",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -8,12 +8,12 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node tests/run-in-node.js"
|
"test": "node tests/run-in-node.js",
|
||||||
, "prepublish": "node src/generate-lists"
|
"prepublish": "node src/generate-lists"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/coolaj86/human-readable-ids-js.git"
|
"url": "https://git.coolaj86.com/coolaj86/human-readable-ids.js.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"hri",
|
"hri",
|
||||||
@ -27,10 +27,10 @@
|
|||||||
"nouns",
|
"nouns",
|
||||||
"adjectives"
|
"adjectives"
|
||||||
],
|
],
|
||||||
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.com/)",
|
"author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
|
||||||
"license": "Apache2",
|
"license": "Apache2",
|
||||||
"bugs": {
|
"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…
x
Reference in New Issue
Block a user