LucaCappelletti94 / dict_hash

Python package to hash dictionaries using default hash, md5, sha256 and more.
MIT License
24 stars 2 forks source link

MAC address object of class EUI('00-1B-77-49-54-FD') are not supported #8

Closed lkpatel closed 2 years ago

lkpatel commented 2 years ago

Hashing of objects of class EUI have failed with following error-

NotImplementedError: Object of class EUI not currently supported

Could you please implement it ?

Regards

LucaCappelletti94 commented 2 years ago

Ehm, what object is that? From what package? What code reproduces the error?

lkpatel commented 2 years ago

The object MAC(Media Access control) address from netaddr python package (https://netaddr.readthedocs.io). In my use case, I want to keep a hash to ensure that MAC addresses have not been changed in a device. Following code will reproduce the error.

from netaddr import *
from dict_hash import sha256
mac_list = [EUI('00-1B-77-49-54-FD')]
print(sha256(mac_list))

Regards

LucaCappelletti94 commented 2 years ago

I have added support for recursively hashable objects, which should include most objects such as EUI. Please do let me know if the latest version I published on PyPI fits the bill for you.

Consider starring the repository and support its development if you found this useful and saved you time :)