message_coder.py 299 B

12345678910111213141516
  1. import hashlib
  2. class message_coder:
  3. @staticmethod
  4. def type_size() -> int:
  5. return 2
  6. @staticmethod
  7. def hash_size() -> int:
  8. return 20
  9. @staticmethod
  10. def _get_hash(target: bytes) -> bytes:
  11. return hashlib.sha1(target, usedforsecurity = False).digest()