Easy to Remember, Readable UUIDs, that are Shakespearean gramatically correct sentences 🥳
npm install uuid-readablesh
curl https://uuid.rocks/plain?readable
Joyce Ange Barrett the Orient of Alco killed Marlyn Hewett Lady and 11 strong bulls
`
Installation
`sh
npm install uuid-readable --save
`
Usage
`js
const id = require('uuid-readable')
console.log( id.generate() )
// Cathleen d Dieball the Monolith of Alderson reflects Arly Arnie Keenan and 18 large ants
`
Pass your own UUID
`js
console.log( id.generate(uuid) )
`
Inverse, get UUID back from Readable UUID
`js
const uuid = '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
const readable = id.generate(uuid)
const inverse = id.inverse(readable)
inverse === uuid // true
`
Low Entropy 32bit Readable (Use as Readable Hash)
`js
const short = id.short(uuid)
// 5 fat toads happily buzzed
// Check Later
id.check(short, uuid) //true
`
MongoDB
`js
const id = require('uuid-readable')
readable_id: {
'type': String,
'default': id
}
// or use as real id
_id: {
'type': String,
'default': id
}
`
How does it work?
UUID is converted to 128 bits.
- 12 bits for first name
- 11 bits for middle name
- 14 bits for last name
- 13 bits for a personal pronoun
- 13 bits for name of place
- 10 bits for verb
- 12 bits for first name
- 11 bits for middle name
- 14 bits for last name
- 5 bits for number of animals
- 6 bits for animal adjective
- 7 bits for animal
For example, 7 bits for animal means we choose one animal from a list of atleast 2**7 = 128` animals