def random_string(length):
 hash = hashlib.sha256()
 ret = 'a'
 while (len(ret) < length):
  hash.update(str(random.random()))
  ret += hash.hexdigest()
 return ret[0:length]

def random_string ( length ) : hash = hashlib . sha256 ( ) ret = 'a' while ( len ( ret ) < length ) : hash . update ( str ( random . random ( ) ) ) ret += hash . hexdigest ( ) return ret [ 0 : length ]
generate random string .