[clug-talk] MD5 difference?

Jamie Furtner jamie at furtner.ca
Thu Sep 29 13:33:22 PDT 2005


Because echo includes a newline character at the end, which changes the
MD5 sum:

jfurtner at nemesis /usr/local/openvpn $ echo test | hexdump -c
0000000   t   e   s   t  \n
0000005

instead, try:
jfurtner at nemesis /usr/local/openvpn $ echo -n test | md5sum
098f6bcd4621d373cade4e832627b4f6  -

Jamie


On Thu, September 29, 2005 2:25 pm, Nick Wiltshire wrote:
> Hi all,
>
>
> why is it that if I do
>
> echo(md5("test"));
>
> in PHP I get 098f6bcd4621d373cade4e832627b4f6
>
> but....
>
> #echo 'test' | md5sum
>
>
> gives me d8e8fca2dc0f896fd7cb4cb0031ba249
>
> Nick
>
>
> _______________________________________________
> clug-talk mailing list clug-talk at clug.ca
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying
>
>
>


-- 
Jamie Furtner jamie at furtner.ca
"The difference between intelligence and stupidity is that
 intelligence has its limits."
  --unknown




More information about the clug-talk mailing list