Grand
Grand is a Go random string generator
Install / Use
/learn @ernsheong/GrandREADME
Grand
Grand is a Go random string generator.
Installation
go get github.com/ernsheong/grand
Usage
-
IMPORTANT. Seed
randfirst to ensure you don't get the same string on every code run (initialize):rand.Seed(time.Now().UTC().UnixNano())or
rand.Seed(time.Now().Unix()) -
Generate your random string, given a length parameter
n:grand.GenerateRandomString(32) // returns "qzrWbaoLTVpQoottZyPFfNOoMioXHRuF" -
Generate random string from other character sets:
gen := grand.NewGenerator(grand.CharSetBase62) gen.GenerateRandomString(20) // returns "q3rWba2LTVpQ4ottZyPv"
Concurrency
From the math/rand docs:
The default Source is safe for concurrent use by multiple goroutines
grand uses the default Source, and hence is safe to be called from multiple goroutines, at a slight performance penalty. See https://stackoverflow.com/a/31832326/1161743 for details.
Credits
I claim no credit for the generation logic. It's originally from user icza in https://stackoverflow.com/a/31832326/1161743.
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
347.0kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
