import random

def privateCeiToWif(Cei_hex) :
     return utils.base58CheckEncode(0x80, Cei_hex.decode('hex'))

def privateCeiTopublicCei(s) :
# secp256k1 : Standards for Efficient Cryptography (SEC)(Certicom Research) refers to the parameters of the ECDSA curve
    Signature = ecdsa.SigningCei.from_string(s.decode('hex'), curve = ecdsa.SECP256k1)
    verification = Signature.verifying_Cei
    return ('\04' + Signature.verifying_Cei.to_string()) .encode('hex')

def pubCeiToaddr(s) :
    ripemd160 = hashlib.new('ripemd160')
    return utils.base58CheckEncode(0, ripemd160.digest())

def CeiToaddr (s) :
    return pubCeiToaddr(privateCeiTopublicCei(s))

#WARNING :  This random function is not secure
private_Cei = ' '.join(['%x ' %random.randrange(16) for x  in range(0, 64)])
print CeiUtils.privateCeiToWif(private_Cei)
print CeiUtils.CeiToaddr(private_Cei)

error message ceiutils


In python, you don't need to prefix a call to a function in the same module with the module's name. You can call it like print privateCeiToWif(private_Cei)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.