-
Notifications
You must be signed in to change notification settings - Fork 591
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
Use md5 hash as disk cache filename if key is too long #15
Comments
This is turning out to be really difficult. The implementation is done, but with a nasty hack involving module maps to include CommonCrypto, which is what I use to calculate the MD5. I'm considering either waiting until Swift has a MD5 function, or using a simpler hashing method. |
Maybe Fowler–Noll–Vo. |
Yeah, something like that is what I used initially. The problem is using the C library CommonCrypto in a Swift framework. FNV can be implemented without external dependencies. |
Oh, I didn't realize he's using CommonCrypto there, sorry. Yeah, then FNV could be the solution 😄 |
Work in progress in this branch. I'm freeing this issue for now. Might return to it later (Beta 7?). |
What's the status on this? Probably we could check this out https://github.com/krzyzanowskim/CryptoSwift/blob/master/CryptoSwift/MD5.swift |
I was waiting for Apple to add the CommonCrypto module, but we can also use this (assuming it actually works). Nice find! |
murmur hash might be a good solution for this. https://github.com/jwerle/murmurhash.c is an example of this and there are 64 bit versions of this as well, all of them CommonCrypto free |
Thanks @madninja. I decided to use CryptoSwift as I'm more familiar with MD5. |
Use md5 hash as disk cache filename if key is too long. Closes #15.
No description provided.
The text was updated successfully, but these errors were encountered: