MCPcopy Index your code
hub / github.com/clips/pattern / _hash

Method _hash

pattern/web/cache/__init__.py:82–84  ·  view source on GitHub ↗
(self, k)

Source from the content-addressed store, hash-verified

80 path = property(_get_path, _set_path)
81
82 def _hash(self, k):
83 k = encode_utf8(k) # MD5 works on Python byte strings.
84 return os.path.join(self.path, md5(k).hexdigest())
85
86 def __len__(self):
87 return len(glob.glob(os.path.join(self.path, "*")))

Callers 5

__contains__Method · 0.95
__setitem__Method · 0.95
__delitem__Method · 0.95
getMethod · 0.95
ageMethod · 0.95

Calls 1

encode_utf8Function · 0.85

Tested by

no test coverage detected