def seguid(seq):
 import hashlib
 import base64
 m = hashlib.sha1()
 try:
  seq = str(seq)
 except AttributeError:
  pass
 m.update(_as_bytes(seq.upper()))
 try:
  return base64.encodebytes(m.digest()).decode().replace('\n', '').rstrip('=')
 except AttributeError:
  pass
 return base64.b64encode(m.digest()).rstrip('=')

def seguid ( seq ) : import hashlib import base64 m = hashlib . sha1 ( ) try : seq = str ( seq ) except AttributeError : pass m . update ( _as_bytes ( seq . upper ( ) ) ) try : return base64 . encodebytes ( m . digest ( ) ) . decode ( ) . replace ( '\n' , '' ) . rstrip ( '=' ) except AttributeError : pass return base64 . b64encode ( m . digest ( ) ) . rstrip ( '=' )
returns the seguid for a sequence .