Fork me on GitHub

I’ve written here about secrets.clj already, a year or two ago. But I’ve improved things since then, so may be someone will find it useful. designed to generate random numbers suitable for security purposes. It has API which is similar to Python’s module:

user=> (sc/token-hex 32)

user=> (sc/token-urlsafe 32)

user=> (sc/token-bytes 16)
#object["[B" 0x3b2454e9 "[B@3b2454e9"]

user=> (sc/randbelow 100)

user=> (sc/choice [8 16 32 64 128])

user=> (sc/choices [8 16 32 64 128] 2)
(128 16)
The library is dead simple, but may be still useful for managing secrets. Source: Feature requests are welcomed, of course. Thank you’ll for attention 😊.

🎉 9
Linus Ericsson09:10:40

Consider using instead of the (wesk) sha1prng that is the default in secureRandom.


I’ll take a look. Thank you very much! ❤️


I’ve created an issue: I’ll fix it soon. Thank you again!