Function: INSERT-WITH-NEW-KEY

Documentation

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.

Source

(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