Skip to content

Instantly share code, notes, and snippets.

@syohex
Created January 28, 2016 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syohex/626af66ba3650252b0a2 to your computer and use it in GitHub Desktop.
Save syohex/626af66ba3650252b0a2 to your computer and use it in GitHub Desktop.
hash region
(defun hash-region (algorithm beg end)
(interactive
(list
(completing-read "Hash type: " '(md5 sha1 sha224 sha256 sha384 sha512))
(if (use-region-p) (region-beginning) (point-min))
(if (use-region-p) (region-end) (point-max))))
(message "%s: %s"
algorithm (secure-hash (intern algorithm) (current-buffer) beg end)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment