The
Tcllib md5 module creates
MD5 message digests.
Documentation edit
- official reference (alternate)
- official reference, development version
Description edit
The
tcllib implementation of MD5 will defer to the md5 from the
Trf package if that is available.
DKF: The version in
Tcllib is partially built on
MD5Pure.
Hexadecimal Representation edit
jmn 2004-02-01: Are there some gotchas the novice user should be aware of here? What happens when you use the binary value returned by
md5::md5 as part of a string, as in the following snippet taken from
Tuplespaceproc tid {tuple} {
return "\#Tuple[::md5::md5 $tuple]"
}
See my comments about half way down that page. Basically it looks like
md5::md5 of the string
hello there test etc returns a value that includes a carriage return. As I guess can be seen by the existence of
0D when you look at the hex result:
% md5 -hex {hello there test etc}
FC7EB2BA07710DECECC688BCEA5BB323
I assume there may be other characters that may cause problems when using the binary result in a string - so presumably one should always use the -hex option for this sort of situation(?)
When and how does one use the binary result then?
PT: You have turned the binary result into the string representation of a binary result there. If you want a string then you should use
-hex or in some other way arrange to protect the data. For instance, once a string function is used any embedded nil chars are going to terminate the data. The binary form is required if you are putting the result into a binary format -- for instance a network protocol or embedded into a file format.