How i can cheek if string start with some text at python3?

40 views Asked by At

Code

from bit import Key
import re
from itertools import *
from collections import Counter
for i in permutations(['a','b','c'], 3):
    b = (''.join(i))
    #print (b)
    addtohex = b.strip()
    heximal = '00000000000000000000000000000000000000000' + addtohex + '00000000000000000000'
    #print (heximal)
    #priv_key_bytes = decode_hex(heximal)
    #priv_key = keys.PrivateKey(priv_key_bytes)
    #pub_key = priv_key.public_key
    #pub_key.to_hex()
    #print(pub_key.to_hex())
    key = Key.from_hex(heximal)
    pub = key.public_key.hex()
    #print (pub)
    if re.findall("^039") in pub:
        print (pub)
        print (key.address)

how i can cheek if as example heximal string is start from 039, i try it with re but it possible slow and it need convert to line. What other ways are possible and better fastest way's ?

0

There are 0 answers