Skip to content

Instantly share code, notes, and snippets.

@tkych
Last active December 13, 2015 22:39
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 tkych/4985964 to your computer and use it in GitHub Desktop.
Save tkych/4985964 to your computer and use it in GitHub Desktop.
check digest script
;;;; Last modified : 2013-02-19 22:33:54 tkych
;;====================================================================
;; Check Digest
;;====================================================================
(ql:quickload :ironclad)
(defun check-digest (file-spec digest-name check-sum)
(loop
:for i :across (ironclad:digest-file
(ironclad:make-digest digest-name)
file-spec)
:collect (format nil "~2,'0X" i) :into acc
:finally (return (string=
(apply #'concatenate 'string acc)
(string-upcase check-sum)))))
;; (check-digest
;; "~/tmp/rhythmbox-2.98.tar.xz"
;; :SHA256
;; "a5c0a18a7c76133d36c7dcbdc37e304eae8272703985b17b540d68603b0c76d5")
;;====================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment