[clug-talk] MD5 difference?

Nick Wiltshire nick at dyna-tech.ca
Thu Sep 29 13:38:16 PDT 2005


Thanks!


On Thursday 29 September 2005 2:33 pm, Jamie Furtner wrote:
> 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



More information about the clug-talk mailing list