title_body: Re-Implementing Policy Hashing in Python
upvoted_answer: It seems I was close, but the str.encode() function was not the correct one to use.
  Also a zero byte needs to be prepended to the data to be hashed. Thanks to user bwbush from the cardano forum for helping me out, couldn't have done this without his help!
  Here's the final solution:
  import hashlib
  from cbor2 import dumps, loads, shareable_encoder, CBORTag
  
  class Sig:
          def __init__(self, hash, slot):
                  self.hash=hash
                  self.slot=slot
  
  
  def default_encoder(encoder,value):
          encoder.encode([1, [[0, bytes.fromhex(value.hash)], [5, value.slot]]])
  
  
  obj=Sig(&quot;37c19eca0d623d804bfeb8951bf1eb0f7fe193deeb71793985dbd25e&quot;, 32241869 + i)
  
  serialized = bytes.fromhex(&quot;00&quot;) + dumps(obj, default=default_encoder, value_sharing=False)
  
  m=hashlib.blake2b(digest_size=28)
  m.update(serialized)
  
  print(m.hexdigest())