FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Moderately revised from 8.2.
8.2 version


Arguments: context &key return

Finalize and return the MD4 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 (md4-init))
#S(excl::md-context :ctx 24752192 :size 16)
cl-user(5): (md4-update c "foo")
cl-user(6): (md4-final c :return :usb8)
#(10 198 112 12 73 29 112 251 134 80 ...)

;;  Potential problem with :return :integer (or :return unspecified
;;  as the default is :integer). The call is to MD4-FILE which calls
;;  MD4-FINAL and returns the value MD4-FINAL returns.
;;  Here we get the md4 value in a shell:
% openssl dgst -md4 -hex image-lubm-report.jpg 
MD4(image-lubm-report.jpg)= fafa002127c737695df8449a51cbecb5

;; Now we get it with MD4-FILE:
cl-user(7): (md4-file "~/image-lubm-report.jpg")
cl-user(8): (format t "~x" *)

;; Note the hex values are the same but if there is a leading 0
;; it is not printed by Lisp, which is dealing with the value 
;; as an integer. The leading 0 is preserved when the :return is :hex.

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

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page has had moderate revisions compared to the 8.2 page.
Created 2019.8.20.

Allegro CL version 9.0
Moderately revised from 8.2.
8.2 version