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

(mobile): ios - calculate hash using CryptoKit #5976

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

shenlong-tanwen
Copy link
Member

Changes made in the PR

  • Uses native CryptoKit to calculate SHA-1 hashes in iOS instead of the dart implementation for better performance

@shenlong-tanwen shenlong-tanwen changed the title Refactor/ios native hash (mobile): ios - calculate hash using CryptoKit Dec 26, 2023
Copy link

cloudflare-pages bot commented Jan 5, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7900be6
Status: ✅  Deploy successful!
Preview URL: https://3dacb896.immich.pages.dev
Branch Preview URL: https://refactor-ios-native-hash.immich.pages.dev

View logs

@jrasm91
Copy link
Contributor

jrasm91 commented Jan 5, 2024

Are there any measurements you can show? Ideally you could output the timings for pre/post new implementation and make sure it's actually working how it should be.

@alextran1502
Copy link
Contributor

Benchmark result

  • Number of assets: 7192

Using Swift

  • Hash result
{
  "hash":[50,41,89,254,196,122,144,222,211,137,116,224,231,77,167,126,45,187,43,70],
  "id":"8F85B2B4-DC66-4E2C-AD75-6CF732887BE3/L0/001",
  "isarId":-9220662956256676000
}
  • Time: 3m 24s

Using Dart

  • Hash result
{
  "hash":[50,41,89,254,196,122,144,222,211,137,116,224,231,77,167,126,45,187,43,70],
  "id":"8F85B2B4-DC66-4E2C-AD75-6CF732887BE3/L0/001",
  "isarId":-9220662956256676000
}
  • Time: 11m 02s

@alextran1502 alextran1502 merged commit d3af2b1 into main Jan 5, 2024
20 checks passed
@alextran1502 alextran1502 deleted the refactor/ios-native-hash branch January 5, 2024 16:49
martabal pushed a commit that referenced this pull request Jan 9, 2024
* ios: calculate hash using CryptoKit

* chore: remove unused crypto dep

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants