MathGroup Archive 2009

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

Search the Archive

Hash function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97505] Hash function
  • From: Ignacio Plazeta <Ignacio.Plazeta at speednet.es>
  • Date: Sat, 14 Mar 2009 05:41:16 -0500 (EST)

Dear Friends

I bet I'm wrong in a childish way but I'm
incapable to overcome the bug.

Why does the following code return discrepant values
when processing two identical file ( CRTL + C , CRTL + V )
placed in two different folders ? Of course, I'm looking on only
the Hash part of the out, being obviously the folder related part.

Warmest regards.
Ignacio

fileIdentifier[myFile_]:=Module[{ tmp , folderPos },
  folderPos = StringPosition[myFile,"\\"]//Flatten//Max;
  tmp={
     FileByteCount[myFile],
     Hash[myFile,"SHA512"],
     StringJoin[
      (If[#>10,ToString[#],"0"<>ToString[#]])&/@FileDate[myFile]
     ],
     StringTake[myFile,folderPos-1],
     StringDrop[myFile,folderPos]
     };
Return[tmp];
]


  • Prev by Date: Re: max. value in a plot?
  • Next by Date: Re: Maintaining a Mathematica bug list
  • Previous by thread: relaxation method for boundary value problem in systems of nonlinear ODEs
  • Next by thread: Re: Hash function