MCPcopy Create free account
hub / github.com/Open-Bee/DataStudio / _get_key

Method _get_key

datastudio/utils/database.py:236–238  ·  view source on GitHub ↗

Get LMDB key for an image path.

(self, image_path: str)

Source from the content-addressed store, hash-verified

234 return self._envs[shard_id]
235
236 def _get_key(self, image_path: str) -> bytes:
237 """Get LMDB key for an image path."""
238 return hashlib.md5(image_path.encode()).hexdigest().encode()
239
240 def _get_shard_id_and_key(self, image_path: str) -> Tuple[int, bytes]:
241 """Get shard ID and LMDB key in one MD5 call (avoid double hashing).

Callers 3

putMethod · 0.95
getMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected