Created
January 28, 2016 10:51
-
-
Save syohex/626af66ba3650252b0a2 to your computer and use it in GitHub Desktop.
hash region
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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