def primary_key_hash(keys):
 if isinstance(keys[0], six.text_type):
  keys[0] = keys[0].encode('utf-8')
 return hashlib.sha1(keys[0]).hexdigest()

def primary_key_hash ( keys ) : if isinstance ( keys [ 0 ] , six . text_type ) : keys [ 0 ] = keys [ 0 ] . encode ( 'utf-8' ) return hashlib . sha1 ( keys [ 0 ] ) . hexdigest ( )
calculate a hash of the primary key used for encryption .