0

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?

Roman Kaganovich
  • 618
  • 2
  • 6
  • 27

1 Answers1

3
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?

keltar
  • 17,711
  • 2
  • 37
  • 42
  • You are right , I paste wrong tcl result it is supposed to be 3474851A3410906697EC77337DF7AAE4 , as in your answer. I've updated the question entry. Thanks! – Roman Kaganovich Nov 25 '13 at 12:08