← 一覧
@lapius/go-uuidgo-uuid
GitHubnpm
<div align="center"> <p align="center"><b>English</b> | <a href="README.ja.md">日本語</a></p> <h1 align="center">UUID Server</h1> <h3 align="center">Generate a UUID on every HTTP request.</h3> <p align="center">A small HTTP server that returns a new UUID each time you access it. Pick any RFC 9562 UUID version with the URL path.</p> <p align="center"> <a href="https://github.com/Lapius7/go-uuid/releases"><img alt="Release" src="https://img.shields.io/github/v/release/Lapius7/go-uuid?label=release&style=flat-square&color=e8833a&logo=github"></a> <a href="https://www.npmjs.com/package/@lapius/go-uuid"><img alt="npm" src="https://img.shields.io/npm/v/@lapius/go-uuid?style=flat-square&color=cb3837&logo=npm"></a> <a href="go.mod"><img alt="Go" src="https://img.shields.io/github/go-mod/go-version/Lapius7/go-uuid?style=flat-square&color=00add8&logo=go&logoColor=white"></a> <a href="LICENSE"><img alt="License" src="https://img.shields.io/github/license/Lapius7/go-uuid?style=flat-square&color=97ca00"></a> <a href="https://github.com/Lapius7/go-uuid/stargazers"><img alt="Stars" src="https://img.shields.io/github/stars/Lapius7/go-uuid?style=flat-square&color=e3b341&logo=github"></a> <a href="https://github.com/Lapius7/go-uuid/commits/main"><img alt="Last commit" src="https://img.shields.io/github/last-commit/Lapius7/go-uuid?style=flat-square&color=3b82f6"></a> </p> <p align="center"> <a href="#try-it">Try it</a> · <a href="#install">Install</a> · <a href="#usage">Usage</a> · <a href="#endpoints">Endpoints</a> </p> </div>

Try it

Call the public server:

curl https://sandbox.lapius7.com/go-uuid/v4

Install

[!IMPORTANT] This package assumes pnpm. Installing with both npm and pnpm leaves two copies of the same command, so use only pnpm add -g.

pnpm add -g @lapius/go-uuid

The package ships prebuilt binaries for Linux (x64, arm64), macOS (x64, arm64), and Windows (x64). You don't need Go. Node.js 18 or later is required. Run the same command to update.

From source

git clone https://github.com/Lapius7/go-uuid.git && cd go-uuid
go run main.go

Usage

Run go-uuid to start an HTTP server on port 7100.

go-uuid

From another terminal, choose the UUID version with the path.

curl http://localhost:7100/    # v7
curl http://localhost:7100/v4  # v4 (random)
curl "http://localhost:7100/v5?name=lapius7.com"

Each request is written to the log (method, path, query, remote address, user agent, and the generated UUID). An invalid parameter returns 400 Bad Request.

Endpoints

PathVersionDescription
/v7Default
/v1v1Timestamp and MAC address based
/v2v2DCE Security. Accepts ?domain=person|group|org (default person) and ?id=<uint32> (default: UID of the user running the server)
/v3v3Name based (MD5). Accepts ?namespace=<UUID> (default: DNS namespace) and ?name=<string> (default example.com)
/v4v4Random
/v5v5Name based (SHA-1). Same parameters as /v3
/v6v6Time-ordered, sortable timestamp
/v7v7Unix millisecond timestamp

Dependencies

License

MIT. See LICENSE.