FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

rmd160-final

Arguments: context &key return

Finalize and return the RMD160 hash from context in a format determined by the return keyword argument.

return can be one of the following values:

cl-user(4): (setq c (rmd160-init))
#S(excl::md-context :ctx 9183168 :size 20)
cl-user(5): (rmd160-update c "foo")
cl-user(6): (rmd160-final c :return :usb8)
#(66 207 162 17 1 142 164 146 253 238 ...)

;;  Potential problem with :return :integer (or :return unspecified
;;  as the default is :integer). The call is to RMD160-FILE which calls
;;  RMD160-FINAL and returns the value RMD160-FINAL returns.
;;
;;  Here we get the rmd160 value in a shell:
% openssl dgst -rmd160 -hex qall.jpg 
RIPEMD160(qall.jpg)= 05e527b6387540cc9162049b5f60e960f00f8299

;; Now we get it with RMD160-FILE:
cl-user(17): (rmd160-file "~/qall.jpg")
33655283890170409359154440781670075183125201561
cl-user(18): (format t "~x" *)
5e527b6387540cc9162049b5f60e960f00f8299
nil
cl-user(19): 

;; Note the hex values are the same but the leading 0 is not printed
;; by Lisp, which is dealing with the value as an integer. The leading
;; 0 is preserved when the :return is :hex:
cl-user(19): (rmd160-file "~/qall.jpg" :return :hex)
"05e527b6387540cc9162049b5f60e960f00f8299"
cl-user(20): 

See MD*, SHA*, HMAC, and other message digest support in miscellaneous.htm. See also digest-final.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version