Randomstring
Cryptographically secure random strings in Go
Install / Use
/learn @leonklingele/RandomstringREADME
Cryptographically secure random strings in Go
I was tired of so many Go apps and libraries being modulo-biased when generating random strings. Here's another library to generate cryptographically secure and unbiased strings. Internally this library uses Go's crypto/rand package which reads from the best random generator your system provides.
tl;dr
# Install library
go get -u github.com/leonklingele/randomstring/v2
// .. and use it. Generate a 30 character long string
s, err := randomstring.Generate(30, randomstring.CharsASCII)
// You can even use your own alphabet "abc". Be careful though!
s, err := randomstring.Generate(30, "abc")
Supported alphabets:
randomstring.CharsNum: Contains numbers from 0-9randomstring.CharsAlpha: Contains the full English alphabet: letters a-z and A-Zrandomstring.CharsAlphaNum: Is a combination of CharsNum and CharsAlpharandomstring.CharsASCII: Contains all printable ASCII characters in code range [32, 126]
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
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).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
