hash method

int hash (String path)

Returns a hash code for path that matches the semantics of equals.

Note that the same path may have different hash codes in different Contexts.

Implementation

int hash(String path) {
  // Make [path] absolute to ensure that equivalent relative and absolute
  // paths have the same hash code.
  path = absolute(path);

  var result = _hashFast(path);
  if (result != null) return result;

  var parsed = _parse(path);
  parsed.normalize();
  return _hashFast(parsed.toString());
}