Usage

Documentation

make-binary-message-digest

Returns the message-digest for OBJECT as a binary string. ID is the symbol for the calling context.

Acceptable objects are string, input-port, blob, or anything that can be converted into a blob. Lists, vectors, and homogeneous-vectors can be converted. Lists and vectors should only be composed of characters, fixnums, or booleans. A boolean is treated as #f = 0 and #t = 1.

An input-port is not closed, but is read to end-of-file.

CONTEXT-INFO is either a procedure that returns an object, or a positive fixnum. When a fixnum a block of memory of length CONTEXT-INFO is allocated (and automatically free'ed). The CONTEXT can be a pointer object or any other Scheme object.

DIGEST-LENGTH The fixnum count of bytes in the result string.

The phase procedures:

[procedure] ({{INIT}} CONTEXT)

Initialization phase procedure. Sets up the CONTEXT, if necessary. The result is ignored.

[procedure] ({{UPDATE}} CONTEXT BYTES COUNT)

Accumulation phase procedure. Must accumulate the COUNTBYTES. BYTES is a Scheme non-immediate object. Will be called one or more times. The result is ignored.

See message-digest-chunk-size to set the number of bytes read per update invocation.

[procedure] ({{FINAL}} CONTEXT RESULT)

Finalization phase procedure. Must build the resulting message-digest in the supplied RESULT string. The result is ignored.

The optional ID is for identification. If not supplied a unique id will be generated.

string->substring-list/shared ; DEPRECATED

Returns a list of CHUNK-SIZE substrings of STRING, on the interval [STARTEND). Defaults are [0 string-length). Any remaining substring less than chunk-size is appended to the list.

The substrings share storage with the STRING!

Byte Oriented!

->byte-vector ; DEPRECATED

[procedure] (->byte-vector OBJECT)

Converts the OBJECT into a byte-vector.

->blob

[procedure] (->blob OBJECT)

Converts the OBJECT into a blob.

Examples

Notes

Bugs and Limitations

Author

Kon Lovett

License

Copyright (c) 2006, 2007 Kon Lovett. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.