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

feat(server): immich checksum header #9229

Merged
merged 2 commits into from
May 2, 2024
Merged

feat(server): immich checksum header #9229

merged 2 commits into from
May 2, 2024

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented May 2, 2024

check for x-immich-checksum and dedupe before handling the full file upload

Copy link

cloudflare-pages bot commented May 2, 2024

Deploying immich with  Cloudflare Pages  Cloudflare Pages

Latest commit: de1694e
Status: ✅  Deploy successful!
Preview URL: https://66d42c7e.immich.pages.dev
Branch Preview URL: https://feat-dedupe-by-checksum.immich.pages.dev

View logs

@@ -0,0 +1,5 @@
export const fromChecksum = (checksum: string): Buffer => {
return Buffer.from(checksum, checksum.length === 28 ? 'base64' : 'hex');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can it be guaranteed that base64 is always 28 characters long? lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benmccann
Copy link
Contributor

Perhaps "hash" would be more accurate than "checksum"? I usually think of a checksum as being used for data integrity

@jrasm91
Copy link
Contributor Author

jrasm91 commented May 2, 2024

Perhaps "hash" would be more accurate than "checksum"? I usually think of a checksum as being used for data integrity

We could also use this for that in the future.

@jrasm91 jrasm91 merged commit ec4eb7c into main May 2, 2024
23 checks passed
@jrasm91 jrasm91 deleted the feat/dedupe-by-checksum branch May 2, 2024 19:42
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