Next: sb-queue, Previous: sb-posix, Up: Contributed Modules

### 16.4 sb-md5

The `sb-md5` module implements the RFC1321 MD5 Message Digest Algorithm. [FIXME cite]

— Function: sb-md5:md5sum-file pathname

> Calculate the MD5 message-digest of the file designated by pathname.

— Function: sb-md5:md5sum-sequence sequence &key start end

> Calculate the MD5 message-digest of data bounded by `start` and `end` in `sequence` , which must be a vector with element-type (UNSIGNED-BYTE 8).

— Function: sb-md5:md5sum-stream stream

> Calculate an MD5 message-digest of the contents of `stream`, whose element-type has to be (UNSIGNED-BYTE 8).

— Function: sb-md5:md5sum-string string &key external-format start end

> Calculate the MD5 message-digest of the binary representation of `string` (as octets) in `external-format`. The boundaries `start` and `end` refer to character positions in the string, not to octets in the resulting binary representation.

#### 16.4.1 Credits

The implementation for CMUCL was largely done by Pierre Mai, with help from members of the `cmucl-help` mailing list. Since CMUCL and SBCL are similar in many respects, it was not too difficult to extend the low-level implementation optimizations for CMUCL to SBCL. Following this, SBCL's compiler was extended to implement efficient compilation of modular arithmetic (see Modular arithmetic), which enabled the implementation to be expressed in portable arithmetical terms, apart from the use of `rotate-byte` for bitwise rotation.