[Zope] OT: possibly... Comparing 2 blobs

Casey Duncan casey@zope.com
Fri, 28 Mar 2003 16:35:17 -0500

This Python script would be simple and fairly efficient in the common cas=
(assuming Zope Fileish objects):

##parameters=3Dfile1, file2
return file1.get_size() =3D=3D file2.get__size() or str(file1) =3D=3D str=

It would only be inefficient for large files that were exactly the same s=
which would be uncommon methinks. To make that case efficient, you would =
to precompute a checksum at upload time and store it as a property for=20

On Friday 28 March 2003 03:33 pm, Bobb wrote:
> Does anyone know of a "reliable" way to compare blobs in python / zope.=
I'm looking a either comparing the first # of characters, or crc check or=
something. =20
> bobb