-
-
Save ekapujiw2002/bd9c463f9161ad00582832648c8dfcc5 to your computer and use it in GitHub Desktop.
Calculate CRC32 of a file in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import binascii | |
def CRC32_from_file(filename): | |
buf = open(filename,'rb').read() | |
buf = (binascii.crc32(buf) & 0xFFFFFFFF) | |
return "%08X" % buf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment