Files
Fulfillment-Backend/utils/hashing_utils.py
2024-09-01 21:45:24 +03:00

11 lines
318 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import pickle
import zlib
def hash_args_and_kwargs_with_crc32(*args, **kwargs):
# Сериализуем args и kwargs с помощью pickle
serialized_data = pickle.dumps((args, kwargs))
# Генерируем хэш CRC32
return format(zlib.crc32(serialized_data) & 0xffffffff, '08x').upper()