Add random id generator
This commit is contained in:
parent
ec139b644c
commit
1212925469
1 changed files with 7 additions and 0 deletions
|
@ -64,4 +64,11 @@
|
|||
(get-universal-time)
|
||||
(random 1000000))))
|
||||
|
||||
(defun generate-random-id ()
|
||||
(let ((charset "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||
(length 11))
|
||||
(coerce (loop repeat length
|
||||
collect (char charset (random (length charset))))
|
||||
'string)))
|
||||
|
||||
(defun string-empty-p (string) (= (length string) 0))
|
||||
|
|
Loading…
Add table
Reference in a new issue