md5

  1. md5
  2. Documentation
    1. MD5 API
      1. Usage
      2. Constants
      3. init
      4. update
      5. raw-update
      6. final
    2. MD5 Primitive
      1. Usage
      2. md5-primitive
  3. Usage
  4. Examples
  5. Notes
  6. Requirements
  7. Author
  8. Repository
  9. Version history
  10. License

Documentation

Computes MD5 checksums

See message-digest-primitive for more information.

MD5 API

Component export

Usage

(use md5-api)

Constants

name
algorithm name ; symbol
version
algorithm version ; string
context-size
context byte length ; fixnum
digest-length
final byte length ; fixnum
block-length
buffer byte length ; fixnum

Note that block-length is informational only.

init

[procedure] (init CTX)

Initializes a MD5 CTX, with at least context-size byte size.

update

[procedure] (update CTX OBJ LEN)

Accumulate LEN bytes from the Scheme OBJ into CTX.

raw-update

[procedure] (raw-update CTX PTR LEN)

Accumulate LEN bytes from the byte PTR into CTX.

final

[procedure] (final CTX OBJ)

Finalize the CTX into a Scheme OBJ with at least digest-length byte size. The target is usually a blob, u8vector, or string.

MD5 Primitive

Packaged export

Usage

(use md5-primitive)

md5-primitive

[procedure] (md5-primitive) -> message-digest-primitive

Returns the 128-bit checksum digest primitive object.

Usage

(import md5)

Examples

(import md5 message-digest-byte-vector)

(message-digest-string (md5-primitive) "abc")
;=> "900150983cd24fb0d6963f7d28e17f72"

Notes

Requirements

message-digest-primitive

Author

Colin Plumb, wrapped for Chicken by Peter Bex, C5 by kon lovett

Repository

This egg is hosted on the CHICKEN Subversion repository:

https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/md5

If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.

Version history

4.1.0
Split into api & primitive modules.
4.0.0
CHICKEN 5 release.
3.2.0
Add raw-update. Kon Lovett
3.1.0
Add block-length. Kon Lovett
3.0.0
Remove deprecated procedures. Kon Lovett
2.5
Make function declarations static in order to avoid conflicts with those from libc if the OS supplies them. This makes MD5 work on OpenBSD (thanks to Alan Post and Christian Kellermann)
2.4
Change deprecated pointer foreign type specifier to scheme-pointer to make it work under chickens newer than 4.6.0.
2.3
Do not define uint32 as uint32_t but use it directly to avoid conflicts with system-defined types on some OSes.
2.2
a message-digest-primitive has no "state". Kon Lovett
2.1
Fixed typo in setup file that caused the extension to get installed under the name "m5"
2.0
Chicken 4 implementation. Replaced GPL code with common public domain code.
1.1
Added dependency on message-digest egg
1.0
Initial release

License

This code implements the MD5 message-digest algorithm.
The algorithm is due to Ron Rivest.  This code was
written by Colin Plumb in 1993, no copyright is claimed.
This code is in the public domain; do with it what you wish.
Equivalent code is available from RSA Data Security, Inc.
This code has been tested against that, and is equivalent,
except that you don't need to include two pages of legalese
with every copy.