💃🆔
Human-Readable Tech Identifiers
![License](https://img.shields.io/npm/l/tech-human-id)
NOTE: This is a fork from https://github.com/RienNeVaPlus/human-id
This includes tech terms only. Check the examples below.
Using words to identify datasets (instead of numbers) provides various advantages when humans are involved, ie
increased distinction and rememberability.
Human-ID generates readable strings by chaining common short words of the english language in a semi-meaningful way.
The result is concatenated of adjective + noun + verb
resulting in a minimum pool size of 28
690 200 possible combinations.
- SFW: no bad words; family friendly results
- No dependencies
Examples
import { humanId } from "tech-human-id";
humanId();
- ShortRecordsReport
- VastTasksEnter
- HugePixelsUse
- FastGraphsAccept
- ShinyPluginsTrack
- ThinCryptosCreate
- ModernHeadersCopy
- WideDevicesLog
- SmartPacketsUpgrade
humanId("-"); // or { "separator": "-" }
- Bright-Backends-Import
- Full-Functions-Start
- Huge-Extensions-Upload
- Solid-Instances-Select
- Smart-Patterns-Monitor
- Swift-Tools-Allow
- Clear-Systems-Program
- Clear-Graphs-Change
- Smooth-Keys-Store
- Thin-Programs-Open
humanId(false); // or { "capitalize": false }
- fastheaderstrack
- colddatabasesmake
- fastindexeschange
- quickstandardsprogram
- freedomainslog
- afraidclassesprogram
- hotdatasetssearch
- opencryptosconnect
- neatcomponentsbuild
Install
Yarn
yarn add tech-human-id
NPM
npm install tech-human-id
Usage
Programmatic
// ES6+
import { humanId, poolSize, minLength, maxLength } from "tech-human-id";
// CommonJS
// const { humanId, poolSize, minLength, maxLength } = require("tech-human-id");
// LightStructuresCreate
console.log(humanId());
// Tough~Frameworks~Export
// alias for { separator: '~' }
console.log(humanId("~"));
// shiny-machines-integrate
console.log(
humanId({
separator: "-",
capitalize: false,
}),
);
console.log(poolSize()); // 4,34,700
console.log(minLength()); // 10
console.log(maxLength()); // 28
Extended Pool Size
For most cases, the default pool size should be large enough. However, the options adjectiveCount
and addAdverb
can be utilized to increase the pool size for the price of the string length.
const options = {
adjectiveCount: 2,
addAdverb: true,
separator: ".",
};
console.log(humanId(options)); // Fast.Fast.Queues.Compile.Optimally
console.log(poolSize(options)); // 28,690,200
console.log(minLength(options)); // 24
console.log(maxLength(options)); // 54
API
humanId(options?: string | Option): string
Generates a human ID. Options can be a string
(separator), a boolean
(capitalize) or an Options
object of:
- separator
string = ''
- Separates the words from each other
- capitalize
boolean = true
- Whether to transform the first character of each word to upper case
- adjectiveCount
number = 1
- How many adjectives to return
- addAdverb
boolean = false
- Adds a fourth part to the id
This function is also available as the default export
poolSize(options?: string | Option): number
Returns the number of possible combinations for a given set of options.
minLength(options?: Option): number
The length of the shortest possible id for a given set of options.
maxLength(options?: Option): number
The length of the longest possible id for a given set of options.
adjectives: string[]
List of possible values for the first part of the human id.
nouns: string[]
List of possible values for the second part of the human id.
verbs: string[]
List of possible values for the third part of the human id.
adverbs: string[]
List of possible values for the optional fourth part of the human id.
💃🆔