https://github.com/ewandennis/word-salad
Human-centric unique identifiers
https://github.com/ewandennis/word-salad
human-readable-representations unique-identifier
Last synced: 5 months ago
JSON representation
Human-centric unique identifiers
- Host: GitHub
- URL: https://github.com/ewandennis/word-salad
- Owner: ewandennis
- Created: 2017-02-20T20:04:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-25T11:52:27.000Z (about 9 years ago)
- Last Synced: 2025-10-15T13:19:20.208Z (8 months ago)
- Topics: human-readable-representations, unique-identifier
- Language: JavaScript
- Size: 636 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Word Salad
Human-centric unique identifers for use in place of numeric record locators, account IDs and so on.
# Installation
Install Word Salad module from NPM:
```bash
npm install word-salad --save
```
# Exploration
Output a random identifier:
```bash
mkWordSalad
```
That will return something like "jet typist" or "indefinable sugarloaf".
To do that programmatically:
```javascript
console.log(require('word-salad').mkID());
```
# Map From Existing Numeric Identifiers
```javascript
const wordSalad = require('word-salad');
const person = {id:101, name:'Sue'}
person.id = wordSalad.fromInt(person.id);
```
# Map To Numeric Identifiers
```javascript
const wordSalad = require('word-salad');
const person = {id:'inimical pizzicato', name:'Sue'}
person.id = wordSalad.toInt(person.id);
```
# Generate A Sequence of Identifiers
```javascript
const wordSalad = require('word-salad');
for(let i = 0; i < 100; ++i) {
console.log(wordSalad.nextID());
}
```