niceid

package module
v0.0.0-...-e476770 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 2 Imported by: 0

README


This is a port of the original to Go.


Nice Identifiers

NiceID generates readable strings by chaining common short English words in a semi-meaningful way. The result is concatenated of adjective + adjective + noun + verb + adverb resulting in a pool size of over 50,850,000,000 possible combinations.

  • SFW: no bad words; family friendly results
  • No dependencies

Examples

  • some-loose-roses-crash-safely
  • late-moody-stars-slide-brightly
  • old-true-baths-relate-busily
  • orange-floppy-lines-wink-freely

Usage

As a Go package

go get github.com/austinjp/niceid
package main

import (
	"fmt"
	"github.com/austinjp/niceid"
)

func main() {
	options := niceid.Options{}
	id := niceid.ID(options)
	fmt.Println(id)

	// Change the word delimeter (default is "-")
	options.Delim = " "
	fmt.Println(id)

	// For a deterministic outcome pass a seeded rand:
	deterministicOptions := Options{
		Rand: rand.New(rand.NewPCG(1, 2)),
	}
	deterministicID := niceid.ID(options)
	fmt.Println(deterministicID)
}

As a CLI tool

go install github.com/austinjp/niceid/cmd/niceid@latest
niceid -n 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Adjectives = []string{} /* 191 elements not displayed */
View Source
var Adverbs = []string{"bravely", "busily", "carefully", "daily", "freely", "hungrily", "joyously", "knowingly", "lazily", "noisily", "oddly", "politely", "quickly", "quietly", "rapidly", "safely", "sleepily", "slowly", "truly", "yearly"}
View Source
var Nouns = []string{} /* 297 elements not displayed */
View Source
var Verbs = []string{} /* 249 elements not displayed */

Functions

func ID

func ID(o Options) string

ID generates a human-friendly identifier of the form:

<adjective>-<adjective>-<noun>-<verb>-<adverb>

Types

type Options

type Options struct {
	Delim string
	Rand  *rand.Rand
}

Options must be passed to ID. Fields:

Delim: word delimeter (default "-")
Rand:  pass *rand.Rand for deterministic output, otherwise
	math/rand/v2 is used

Directories

Path Synopsis
cmd
niceid command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL