def get_secure_random_string(size):
 value = os.urandom(size)
 value = binascii.hexlify(value)
 value = value.decode('utf-8')[:size]
 return value

def get_secure_random_string ( size ) : value = os . urandom ( size ) value = binascii . hexlify ( value ) value = value . decode ( 'utf-8' ) [ : size ] return value
return a string of size random bytes .