MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Reproducing a hash code

  • To: mathgroup at
  • Subject: [mg82989] Re: Reproducing a hash code
  • From: michael.p.croucher at
  • Date: Tue, 6 Nov 2007 03:42:22 -0500 (EST)
  • References: <fgmppa$9i5$>

On 5 Nov, 10:03, "Steve Luttrell"
<steve at> wrote:
> I am trying to get results from Mathematica's Hash function (for hash type
> "MD5") that are consistent with the results obtained using "openssl md5" in
> Linux.
> The particular example I would like to reproduce is on, where
> "Hello, Avatar!:0"
> hashes to (for hash type "MD5")
> 112abd47ceaae1c05a826828650434a6
> In Mathematica 6 (Windows Vista, Intel hardware), doing the obvious
> Hash["Hello, Avatar!:0", "MD5"] // BaseForm[#, 16] &
> I get the following result
> a8c2ab1662a37cb9f8ea5af154a48c52
> This is not the same as expected. Does anyone know how to get consistent
> results?
> --
> Steve Luttrell
> West Malvern, UK

Hi Steve

It seems that Mathematica includes the enclosing quotes "" when it
generate it's hash:

As you point out, in Mathematica 6 (on windows and Linux) if we do
Hash["Hello, Avatar!:0", "MD5"] // BaseForm[#, 16] &
we get

Now onto our linux box - if we do (notice the extra quotes I have

echo -n '"Hello, Avatar!:0"' | openssl md5

we get


as before.
Hope this helps,

  • Prev by Date: Re: NDSolve with functions of vectors
  • Next by Date: Re: How to solve coupled ODEs and PDEs(2ode+2pde) with NDSolve
  • Previous by thread: Reproducing a hash code
  • Next by thread: Re: Reproducing a hash code