Skip to content

Commit

Permalink
cms-2016-collision-datasets: fix RECO checksum generation
Browse files Browse the repository at this point in the history
Changes the checksum generation for RECO configuration to Adler32 that
is being used on EOSPUBLIC.
  • Loading branch information
tiborsimko committed Mar 8, 2024
1 parent 118cc31 commit 7f9bd2e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
Create RECO CMS Configuration Files records.
"""

import hashlib
import json
import re
import os
import shutil
import zlib


NOTE = (
Expand Down Expand Up @@ -107,9 +107,9 @@ def get_size(afile):


def get_checksum(afile):
"""Return the SHA1 checksum of the configuration file."""
"""Return the ADLER32 checksum of a file."""
file_path = "./inputs/config-store/" + afile
return hashlib.sha1(open(file_path, "rb").read()).hexdigest()
return hex(zlib.adler32(open(file_path, "rb").read(), 1) & 0xFFFFFFFF)[2:]


def main():
Expand Down

0 comments on commit 7f9bd2e

Please sign in to comment.