Adler

Collection of DIRAC useful adler32 related tools.
By default on Error they return None.

Warning

On error False is returned.

Warning

All exceptions report to the stdout.

DIRAC.Core.Utilities.Adler.compareAdler(adler1, adler2)

Check equality between two adler32 checksums.

Parameters:
  • adler1 – 1st checksum
  • adler2 – 2nd checksum
Returns:

True (False) if cheksums are (not) equal

DIRAC.Core.Utilities.Adler.fileAdler(fileName)

Calculate alder32 checksum of the supplied file.

Parameters:fileName (str) – path to file
DIRAC.Core.Utilities.Adler.hexAdlerToInt(hexAdler, pos=True)

Change hex base to decimal for adler32 checksum.

Parameters:
  • hexAdler (mixed) – hex based adler32 checksum integer or a string
  • pos (boolean) – flag to determine sign (default True = positive)
DIRAC.Core.Utilities.Adler.intAdlerToHex(intAdler)

Change adler32 checksum base from decimal to hex.

Parameters:intAdler (integer) – adler32 checksum
Returns:8 digit hex string
DIRAC.Core.Utilities.Adler.stringAdler(string)

Calculate adler32 of the supplied string.

Parameters:string (str) – data