OSDN Git Service

add get_entropy
[bytom/pybtm.git] / pybtm / key.py
1 import random
2
3 def get_entropy():
4     entropy = random.randint(0, 2**128)
5     entropy_hexstr = entropy.to_bytes(16, byteorder='big').hex()
6     return entropy_hexstr