| Description: |
In tclsh (8.3):
% package require tcllib
1.2
% md5::md5 507
::hex: wrong # args, all options require an argument
I have Trf 2.1p2 installed, which means the following
code is executed from md5.tcl:
-------------------------------------------
# Trf is available, so implement the functionality
provided here
# in terms of calls to Trf for speed.
proc ::md5::md5 {msg} {
string tolower [::hex -mode encode [::md5 $msg]]
}
-------------------------------------------
The reason for the failure is that [::md5 $msg] returns
a binary result starting with '-', which causes the
::hex to think there is another option.
The fix is to insert "--" following the "encode":
-------------------------------------------
proc ::md5::md5 {msg} {
string tolower [::hex -mode encode -- [::md5 $msg]]
}
-------------------------------------------
There is at least one other occurrence of the same bug
in md5.tcl, and I would imagine this could also occur
where ::hex or other encoding functions are called.
I'm willing to fix this bug.
|