2021-06-03 15:40:51 +02:00
|
|
|
# standard imports
|
2021-08-06 18:29:01 +02:00
|
|
|
import os
|
2021-06-03 15:40:51 +02:00
|
|
|
import random
|
|
|
|
import uuid
|
|
|
|
|
|
|
|
# external imports
|
2021-08-06 18:29:01 +02:00
|
|
|
from chainlib.eth.address import to_checksum_address
|
2021-06-03 15:40:51 +02:00
|
|
|
from faker import Faker
|
|
|
|
from faker_e164.providers import E164Provider
|
|
|
|
|
|
|
|
# local imports
|
|
|
|
|
|
|
|
# test imports
|
|
|
|
|
|
|
|
fake = Faker()
|
|
|
|
fake.add_provider(E164Provider)
|
|
|
|
|
|
|
|
|
|
|
|
def phone_number() -> str:
|
|
|
|
return fake.e164('KE')
|
|
|
|
|
|
|
|
|
2021-08-06 18:29:01 +02:00
|
|
|
def blockchain_address() -> str:
|
|
|
|
return to_checksum_address('0x' + os.urandom(20).hex())
|
|
|
|
|
|
|
|
|
2021-06-03 15:40:51 +02:00
|
|
|
def session_id() -> str:
|
|
|
|
return uuid.uuid4().hex
|
|
|
|
|
|
|
|
|
|
|
|
def pin_number() -> int:
|
|
|
|
return random.randint(1000, 9999)
|