Guest User

Untitled

a guest
May 24th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. (defun file-hash (fname)
  2. "Return sha256 of file."
  3. (interactive)
  4. (with-temp-buffer
  5. (call-process "sha256sum" nil t nil "-b" fname)
  6. (buffer-substring-no-properties (point-min) (+ (point-min) 64))))
  7.  
  8. (defun string-hash (str)
  9. "Return sha256 of string."
  10. (interactive)
  11. (upcase (secure-hash 'sha256 str)))
Add Comment
Please, Sign In to add comment