|
|
|
@ -4,7 +4,9 @@
|
|
|
|
|
|
|
|
|
|
(def- masks [15 31 63 127 255])
|
|
|
|
|
|
|
|
|
|
(defn gen [&keys {:size size
|
|
|
|
|
(defn gen
|
|
|
|
|
"Generate secure random ID. Default size of 21."
|
|
|
|
|
[&keys {:size size
|
|
|
|
|
:alphabet alphabet}]
|
|
|
|
|
(default size 21)
|
|
|
|
|
(default alphabet DEFAULT_ALPHABET)
|
|
|
|
@ -24,7 +26,9 @@
|
|
|
|
|
(string/from-bytes ;result)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn gen-non-secure [&keys {:size size
|
|
|
|
|
(defn gen-non-secure
|
|
|
|
|
"Generate pseudorandom ID. Default size of 21."
|
|
|
|
|
[&keys {:size size
|
|
|
|
|
:alphabet alphabet
|
|
|
|
|
:rng rng}]
|
|
|
|
|
(default size 21)
|
|
|
|
|