Skip to content

code #5

@Leizhenpeng

Description

@Leizhenpeng

def random_secret():

def random_secret():
    # convert hex string to integer in Python
    convert_to_int = lambda array: int("".join(array), 16)
    # 从OS的密码学安全的随机数发生器中收集256位随机数据
    byte_array =binascii.hexlify(os.urandom(32)).decode()

    return convert_to_int(byte_array)

would be better

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions