2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 11:57:37 +00:00

Fix incorrect length of random strings

This commit is contained in:
Jarrod Johnson 2020-10-29 10:57:49 -04:00
parent 7a2b295945
commit bddbc37e8e

View File

@ -79,7 +79,7 @@ def randomstring(length=20):
if length % 4 > 0:
chunksize += 1
strval = base64.urlsafe_b64encode(os.urandom(chunksize * 3))
return stringify(strval[0:length-1])
return stringify(strval[0:length])
def securerandomnumber(low=0, high=4294967295):