Next: Change Hooks, Previous: Base 64, Up: Text
MD5 cryptographic checksums, or message digests, are 128-bit “fingerprints” of a document or program. They are used to verify that you have an exact and unaltered copy of the data. The algorithm to calculate the MD5 message digest is defined in Internet RFC11321. This section describes the Emacs facilities for computing message digests.
This function returns the MD5 message digest of object, which should be a buffer or a string.
The two optional arguments start and end are character positions specifying the portion of object to compute the message digest for. If they are
nil
or omitted, the digest is computed for the whole of object.The function
md5
does not compute the message digest directly from the internal Emacs representation of the text (see Text Representations). Instead, it encodes the text using a coding system, and computes the message digest from the encoded text. The optional fourth argument coding-system specifies which coding system to use for encoding the text. It should be the same coding system that you used to read the text, or that you used or will use when saving or sending the text. See Coding Systems, for more information about coding systems.If coding-system is
nil
or omitted, the default depends on object. If object is a buffer, the default for coding-system is whatever coding system would be chosen by default for writing this text into a file. If object is a string, the user's most preferred coding system (see prefer-coding-system) is used.Normally,
md5
signals an error if the text can't be encoded using the specified or chosen coding system. However, if noerror is non-nil
, it silently usesraw-text
coding instead.