Function: server-generate-key

server-generate-key is an interactive and byte-compiled function defined in server.el.gz.

Signature

(server-generate-key)

Documentation

Generate and return a random authentication key.

The key is a 64-byte string of random chars in the range !..~. If called interactively, also inserts it into current buffer.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/server.el.gz
(defun server-generate-key ()
  "Generate and return a random authentication key.
The key is a 64-byte string of random chars in the range `!'..`~'.
If called interactively, also inserts it into current buffer."
  (interactive)
  (let ((auth-key
	 (cl-loop repeat 64
                  collect (+ 33 (random 94)) into auth
                  finally return (concat auth))))
    (if (called-interactively-p 'interactive)
	(insert auth-key))
    auth-key))