Function: embark--define-hash

embark--define-hash is a macro defined in embark.el.

Signature

(embark--define-hash ALGORITHM)

Documentation

Define command which computes hash from a string.

ALGORITHM is the hash algorithm symbol understood by secure-hash.

Source Code

;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark.el
(defmacro embark--define-hash (algorithm)
  "Define command which computes hash from a string.
ALGORITHM is the hash algorithm symbol understood by `secure-hash'."
  `(defun ,(intern (format "embark-hash-%s" algorithm)) (str)
     ,(format "Compute %s hash of STR and store it in the kill ring." algorithm)
     (interactive "sString: ")
     (let ((hash (secure-hash ',algorithm str)))
       (kill-new hash)
       (message "%s: %s" ',algorithm hash))))