helper method. generates random strings of length key-length until it finds one that isn't a key in hash-table and sets value to that. returns the new id.
(defun insert-with-new-key (hash-table key-length value)
"helper method. generates random strings of length key-length until
it finds one that isn't a key in hash-table and sets value to
that. returns the new id."
(let ((key (new-random-key hash-table key-length)))
(setf (gethash key hash-table) value)
key))Source Context