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

digest-string

Arguments: name string start end external-format return foreign

You may need to evaluate (require :digest) to load the digest code before calling this function.

Using digest-init (which creates a context), digest-update (which updates the context with the argument string), and digest-final (which calculates the hash of the resulting context), this function computes the hash for string.

name can be one of the symbols md4, md5, sha1, sha224, sha256, sha384, sha512, and rmd160, specifying the type of hashing.

The start and end arguments specify the portion of the string to be considered and the external-format argument specifies the external hashing of the string that will be used to update the context.

To use the entire string, specify 0 for start and nil (or (length string)).

You can use :default as the value of external-format to use to the default external format. These arguments, along with string, are passed to digest-update.

The format of the result, just as for digest-final, is determined by the return keyword argument. The possible values are :integer, :usb8, and :hex. See digest-final for information on these values and the corresponding formats of the returned value.

If foreign is non-nil, then string must (despite the argument name) be an integer address in foreign memory (such as what would be passed to sys:memref) and the bytes contained at that address are used as the input to the digest function.

cl-user(4): (digest-string 'md5 "foo" 0 nil :default :integer nil)  
229609063533823256041787889330700985560
cl-user(5): (digest-string 'md5 "foo" 0 nil :default :usb8 nil)
#(172 189 24 219 76 194 248 92 237 239 ...)
cl-user(6): 

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


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 9.0 page.
Created 2015.5.21.

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