def hash_path(account, container=None, object=None, raw_digest=False):
 if (object and (not container)):
  raise ValueError('container is required if object is provided')
 paths = [account]
 if container:
  paths.append(container)
 if object:
  paths.append(object)
 if raw_digest:
  return md5((((HASH_PATH_PREFIX + '/') + '/'.join(paths)) + HASH_PATH_SUFFIX)).digest()
 else:
  return md5((((HASH_PATH_PREFIX + '/') + '/'.join(paths)) + HASH_PATH_SUFFIX)).hexdigest()

def hash_path ( account , container = None , object = None , raw_digest = False ) : if ( object and ( not container ) ) : raise ValueError ( 'container is required if object is provided' ) paths = [ account ] if container : paths . append ( container ) if object : paths . append ( object ) if raw_digest : return md5 ( ( ( ( HASH_PATH_PREFIX + '/' ) + '/' . join ( paths ) ) + HASH_PATH_SUFFIX ) ) . digest ( ) else : return md5 ( ( ( ( HASH_PATH_PREFIX + '/' ) + '/' . join ( paths ) ) + HASH_PATH_SUFFIX ) ) . hexdigest ( )
get the connonical hash for an account/container/object .