Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple file hashes #67

Open
baszalmstra opened this issue Feb 17, 2024 · 1 comment
Open

Multiple file hashes #67

baszalmstra opened this issue Feb 17, 2024 · 1 comment

Comments

@baszalmstra
Copy link

I was wondering whether it would be possible to store a single entry under multiple hashes by computing multiple hashes at the same time and hard linking the content in the cache.

In some usecases it makes sense to use one hash over another, because you might want to use the hash outside of the cache, but as I understand it correctly content would be duplicated when using two hashes for the same content.

An integrity can already contain multiple hashes but I think the API doesnt offer support to store/calculate multiple hashes.

@zkat
Copy link
Owner

zkat commented Feb 17, 2024

The easiest way to do this is to do your own wrapper around the index functions and create mock index entries and store the different variants in their metadata field. Your function can then return the appropriate variant from there. Does that make sense? I'm otherwise not sure how I feel about adding this kind of functionality directly to cacache, esp since it's so easy to roll your own with the tools that are there already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants