1.0.0 • Published 1 year ago

goofy-names v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

goofy-names

Generate a deterministic Docker container-like name from a string

Works both in a browser and in Node.js.

~2.8Kb gzip compressed, requires only simple-sha1.

Uses SHA1 hash for both complete determinism and a very good distribution.

Installation

npm i goofy-names

Usage

const goofyName = require("goofy-names");

const name = goofyName("3ccf40d8-901f-11ed-aaba-c347cf56a42d");

name === "Dreamy Poincare";
// Your bundler must handle JSON (it is usually the case)
import goofyName from "goofy-names";

const name = goofyName("3ccf40d8-901f-11ed-aaba-c347cf56a42d");

name === "Dreamy Poincare";

Copyright

Stolen from the Moby Project while keeping the original Apache License.