Example #1
0
 def code_hashid(self, txt):
     x = to_bytes(txt, 'utf8')
     hash = sha256(x).hexdigest()
     return hash[-3:].upper()
Example #2
0
File: qt.py Project: nvk/electrum
 def code_hashid(self, txt):
     x = to_bytes(txt, 'utf8')
     hash = sha256(x).hexdigest()
     return hash[-3:].upper()
Example #3
0
 def code_hashid(cls, txt: str) -> str:
     txt = txt.lower()
     x = to_bytes(txt, 'utf8')
     hash = sha256(x).hexdigest()
     return hash[-3:].upper()
Example #4
0
 def code_hashid(cls, txt: str) -> str:
     txt = txt.lower()
     x = to_bytes(txt, 'utf8')
     hash = sha256(x).hexdigest()
     return hash[-3:].upper()
Example #5
0
 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]