Question

The following tcl code generate the different result than md5sum executable

#!/usr/bin/tclsh 

package require md5

puts [md5::md5 -hex "test_string"]

the result is:

3474851A3410906697EC77337DF7AAE4

In UNIX shell:

echo "test_string" | md5sum

the result is:

fd77c0776e992fc96647b3bc220b3adc  -

Why the results are different?

Was it helpful?

Solution

puts [md5::md5 -hex "test_string"]

3474851A3410906697EC77337DF7AAE4

echo -n "test_string" | md5sum

3474851a3410906697ec77337df7aae4 -

So - wrong echo, but what's with your tcl? Are you sure you posted correct example?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top