Python随机生成指定长度字符串

In [7]: import os                                                                                                                                                                                                                  

In [8]: import base64                                                                                                                                                                                                              

In [9]: base64.b64encode(os.urandom(48))                                                                                                                                                                                           
Out[9]: b'ITk0zqRg18SMvh7XS6WEa4KTaLLcHPWRlSJk5+QJI2KiBm85h702IWUZb+ai8B3G'


你可能感兴趣的:(Python)