import hashlib import zlib import sys def calculate_git_hash(file_path): # Read the file content with open(file_path, 'rb') as f: content = f.read() # Decompress the zlib-compressed content decompressed_content = zlib.decompress(content) # Calculate the SHA-1 hash of the decompressed content sha1 = hashlib.sha1(decompressed_content).hexdigest() return sha1 if __name__ == "__main__": if len(sys.argv) != 2: print("Usage: python get_hash.py ") else: file_path = sys.argv[1] hash_value = calculate_git_hash(file_path) print(f"{hash_value}")