safe enough 8-character short unique random string

前端 未结 7 1346
甜味超标
甜味超标 2021-02-01 01:34

I am trying to compute 8-character short unique random filenames for, let\'s say, thousands of files without probable name collision. Is this method safe enough?



        
7条回答
  •  孤城傲影
    2021-02-01 02:28

    You can try the shortuuid library.

    Install with : pip install shortuuid

    Then it is as simple as :

    > import shortuuid
    > shortuuid.uuid()
    'vytxeTZskVKR7C7WgdSP3d'
    

提交回复
热议问题