Compare commits

...

15 Commits

Author SHA1 Message Date
AJ ONeal 6daa62689d update urls 2018-06-01 02:58:45 -06:00
Drew Warren dca721f8ac v1.0.3 2017-07-10 11:57:28 -06:00
Drew Warren 28ce5450f2 Typo in readme 2017-07-10 11:57:21 -06:00
Drew Warren 3b5f24e02e v1.0.2 2017-07-10 11:54:55 -06:00
Drew Warren 8b87f2848b Update README with GitLab urls 2017-07-10 11:53:48 -06:00
AJ ONeal 8c2655d5fa Update README.md 2017-07-07 17:33:20 -06:00
AJ ONeal 2631d3d0cb Update README.md 2017-07-07 17:32:35 -06:00
AJ ONeal 413e3a8d5d Update README.md 2017-07-07 17:32:16 -06:00
AJ ONeal 943d95bc9b Update package.json 2017-07-07 17:29:19 -06:00
AJ ONeal 781ee7b9b1 Update README.md 2017-07-07 17:26:41 -06:00
AJ ONeal a05aed1495 Update README.md 2016-11-25 11:03:55 -07:00
AJ ONeal cdb4aa97d0 typo fix 100,000 -> 1,000,000 2015-02-19 09:21:05 -07:00
AJ ONeal 700e4a375d added more links and stuff 2014-07-21 10:27:57 -06:00
AJ ONeal d28f7122c3 link to more resources 2014-07-21 10:13:41 -06:00
AJ ONeal 13f8b90523 added more links and stuff 2014-07-21 10:00:45 -06:00
3 changed files with 42 additions and 24 deletions

View File

@ -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
====

View File

@ -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>"

View File

@ -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"
}