def code_hashid(self, txt): x = to_bytes(txt, 'utf8') hash = sha256(x).hexdigest() return hash[-3:].upper()
def code_hashid(cls, txt: str) -> str: txt = txt.lower() x = to_bytes(txt, 'utf8') hash = sha256(x).hexdigest() return hash[-3:].upper()
def b58_address_to_hash160(cls, addr): addr = to_bytes(addr, 'ascii') _bytes = base_decode(addr, length=27, base=58) return _bytes[0:3], _bytes[3:23]