Go package and associated command line utility to generate random yet human-readable names and identifiers

namegen | GitHub license GoReportCard

preview

What's this?

Go package and associated command line utility to generate random yet human-readable names and identifiers. Somewhat inspired by the random names that Docker gives its containers and GCP uses as project-ids.

For instance it came up with gems like this:

bougee.coorgi

young-flamingo

articulate-otter-92

ancient-mako-7ab1g3

mighty-pale-pikachu-7133

Examples

Build

Owner
Comments
  • Extend the dictionary_test to spot duplicates across dictionaries

    Extend the dictionary_test to spot duplicates across dictionaries

    Today there exists logic to detect duplicates within a given dictionary of words. We need to add a test to spot duplicates across dictionaries too. For instance colors might show up in the color and adjective dictionaries which when used together could end up creating names with duplicate words in them.

  • Preallocate strings.Builder

    Preallocate strings.Builder

    Since we know the size of all the random strings as well as the postfix before hand, we can preallocate the builder to cut down on resizes and to make the memory allocations more deterministic.

  • Optimize allocations in GetForId()

    Optimize allocations in GetForId()

    GetForId() makes 3 allocations without prefix and 5 with. This is mostly down to initialized array appends and the call to strings.Join. Also evaluate and use strings.Builder to cut down on concatenation related allocations.

    Benchmark outputs for reference: BenchmarkGet-4 4428757 256.4 ns/op 65 B/op 3 allocs/op BenchmarkGetWithPostfix-4 2684820 440.3 ns/op 162 B/op 5 allocs/op

  • Optimize getPostfixId() memory usage

    Optimize getPostfixId() memory usage

    The getPostfixId implementation first encodes the random number into base-10 or base-36 and then returns a substring of it. These encoded intermediary strings are 24 Bytes long in the common case. But the returned strings are typically 1-8 Bytes, leading to a large amount of fragmentation and trapped memory.

  • Add test to spot duplicates across dictionaries

    Add test to spot duplicates across dictionaries

    This PR fixes #6 by adding TestDictionarySanity/ShouldNotHaveDuplicateAcrossDictionaries.

    In addition, we also move the existing TestDictionarySanity assertions to TestDictionarySanity/ShouldBeSortedAndNotHaveDuplicateOnEachDictionary.

  • Evaluate reusing the strings.Builder object

    Evaluate reusing the strings.Builder object

    Every call to GetForId() creates a new strings.Builder object. Although this allocation should happen on the stack and is not a concern as such, see if it would help to Reset() the builder instead of creating a new one each time. Might come in useful particularly when we need not return the string such as with #9

Generate random, pronounceable, sometimes even memorable, "superhero like" codenames - just like Docker does with container names.

Codename an RFC1178 implementation to generate pronounceable, sometimes even memorable, "superheroe like" codenames, consisting of a random combinatio

Dec 11, 2022
Generate possible AD usernames from names like John Doe > J.Doe or JDoe

GOtusernames Generate possible AD usernames from names like John Doe > J.Doe or JDoe Example user file: ~/programming/golang/src/gotyourusername ❯ cat

Dec 13, 2022
Portapps is not affiliated, associated, authorized, endorsed by, or in any way officially connected with IntelliJ IDEA
Portapps is not affiliated, associated, authorized, endorsed by, or in any way officially connected with IntelliJ IDEA

Portapps is not affiliated, associated, authorized, endorsed by, or in any way officially connected with IntelliJ IDEA

Feb 27, 2022
Names things like they're action movies from the mid 90s.

thing-namer Names things like they're action movies from the mid 90s. Installing You know the drill. go get github.com/Unquabain/thing-namer Building

Nov 6, 2021
Autoname - Friendly names generator with golang

autoname Friendly names generator inspired by moby's work. import "github.com/ci

Oct 16, 2022
Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.
  Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

gore Yet another Go REPL that works nicely. Featured with line editing, code completion, and more. (Screencast taken with cho45/KeyCast) Usage gore Af

Jan 7, 2023
A command line tool to generate sequence diagrams
A command line tool to generate sequence diagrams

goseq - text based sequence diagrams A small command line utility used to generate UML sequence diagrams from a text-base definition file. Inspired by

Dec 22, 2022
Package reservoir samples values uniformly at random from an unbounded sequence of inputs

Package reservoir samples values uniformly at random from an unbounded sequence of inputs

Oct 5, 2022
A command-line tool that triggers command when the input (doesn't) comes from STDIN in an interval.

conk A command-line tool that triggers command when the input (doesn't) comes from STDIN in an interval. Usage $ conk -h A command-line tool that trig

Apr 29, 2022
Random fake data and struct generator for Go.

Faker Random fake data and struct generator for Go. More than 100 generator functions Struct generator Unique data generator Builtin types support Eas

Oct 3, 2022
Helps exercise your memory by giving you random tokens and poems to memorize.

memory-enhancer Helps exercise your memory by giving you random tokens and poems to memorize. Using Every day when you first open your terminal you wi

Nov 9, 2021
Random fake data generator written in go
Random fake data generator written in go

Gofakeit Random data generator written in go Features 160+ Functions!!! Concurrent Global Rand Struct Generator Custom Functions Http Server Command L

Jan 1, 2023
A repository of random code snippets used to develop proof of concepts

Oddments Oddments is a repository of random code snippets used to develop proof of concepts for techniques used with the Windows operating system. POC

Oct 13, 2022
Randomdata : a tiny help suite for generating random data

go-randomdata randomdata is a tiny help suite for generating random data such as first names (male or female) last names full names (male or female) c

Dec 5, 2021
Rfpm - Random Fair Preemption Model For Golang

rfpm RFPM (Random Fair Preemption Model) is absolutely fair to all clients who r

Jan 7, 2022
A tool to generate Pulumi Package schemas from Go type definitions

MkSchema A tool to generate Pulumi Package schemas from Go type definitions. This tool translates annotated Go files into Pulumi component schema meta

Sep 1, 2022
Wordle - Wordle on command line

wordle Play WORDLE on the command line. Installation go install github.com/howey

May 19, 2022
The command-line client for Cloudflare Tunnel

Cloudflare Tunnel client Contains the command-line client for Cloudflare Tunnel, a tunneling daemon that proxies traffic from the Cloudflare network t

Feb 10, 2022
Ghdl - A much more convenient way to download GitHub release binaries on the command line, works on Win & Unix-like systems

ghdl Memorize ghdl as github download ghdl is a fast and simple program (and als

Oct 12, 2022