def _seed(a=None, max_bytes=8):
 if (a is None):
  a = _bigint_from_bytes(os.urandom(max_bytes))
 elif isinstance(a, str):
  a = a.encode('utf8')
  a += hashlib.sha512(a).digest()
  a = _bigint_from_bytes(a[:max_bytes])
 elif isinstance(a, integer_types):
  a = (a % (2 ** (8 * max_bytes)))
 else:
  raise error.Error('Invalid type for seed: {} ({})'.format(type(a), a))
 return a

def _seed ( a = None , max_bytes = 8 ) : if ( a is None ) : a = _bigint_from_bytes ( os . urandom ( max_bytes ) ) elif isinstance ( a , str ) : a = a . encode ( 'utf8' ) a += hashlib . sha512 ( a ) . digest ( ) a = _bigint_from_bytes ( a [ : max_bytes ] ) elif isinstance ( a , integer_types ) : a = ( a % ( 2 ** ( 8 * max_bytes ) ) ) else : raise error . Error ( 'Invalid type for seed: {} ({})' . format ( type ( a ) , a ) ) return a
create a strong random seed .