Skip to content

Instantly share code, notes, and snippets.

@jilleb
Created December 16, 2021 11:01
Show Gist options
  • Save jilleb/7980fa8e696542ca95c2e55d326a86a9 to your computer and use it in GitHub Desktop.
Save jilleb/7980fa8e696542ca95c2e55d326a86a9 to your computer and use it in GitHub Desktop.
CRC32_ADLATUS calculator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Created By : Jille
# This is meant specifically for calculating CRC32_ADLATUS for a file
import sys
import crcmod
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("filename")
args = parser.parse_args()
data = open(args.filename, 'rb').read()
crc32_adlatus = crcmod.mkCrcFun(0x104c11db7, initCrc=0, xorOut=0, rev=True)
crc = crc32_adlatus(data)
print (" CRC32_ADLATUS: %08x" %(crc))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment