PR#1612: use right top limit
Merges #1612 https://pagure.io/koji/pull-request/1612 Fixes: #1611 https://pagure.io/koji/issue/1611 generate_token can create longer tokens than needed
This commit is contained in:
commit
badb40d5f8
1 changed files with 1 additions and 1 deletions
|
|
@ -5560,7 +5560,7 @@ def generate_token(nbytes=32):
|
|||
if secrets:
|
||||
return secrets.token_hex(nbytes=nbytes)
|
||||
else:
|
||||
values = ['%02x' % random.randint(0, 256) for x in range(nbytes)]
|
||||
values = ['%02x' % random.randint(0, 255) for x in range(nbytes)]
|
||||
return ''.join(values)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue