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(fingerprint): add fingerprint table and corresponding db interface #75

Merged
merged 15 commits into from
Feb 7, 2024

Conversation

ShankarSinghC
Copy link
Contributor

@ShankarSinghC ShankarSinghC commented Feb 6, 2024

The fingerprint table consists of three columns: id, card_hash, and card_fingerprint. The insert_fingerprint function takes the card details and the hash key. It calculates the card hash using the hmac-sha512 algorithm. This card hash is used as a lookup in the fingerprint table. If a match is found, the corresponding card_fingerprint is returned. If no match is found, then a nano id for that card_hash is generated which will used as fingerprint for that particular card and inserted into the fingerprint table, and the corresponding fingerprint is returned in the response.

@ShankarSinghC ShankarSinghC linked an issue Feb 7, 2024 that may be closed by this pull request
migrations/2024-02-06-064347_add-fingerprint-table/up.sql Outdated Show resolved Hide resolved
src/error/transforms.rs Outdated Show resolved Hide resolved
src/error/transforms.rs Outdated Show resolved Hide resolved
src/storage.rs Outdated Show resolved Hide resolved
src/storage.rs Outdated Show resolved Hide resolved
src/storage/db.rs Outdated Show resolved Hide resolved
src/storage/types.rs Outdated Show resolved Hide resolved
src/storage/types.rs Outdated Show resolved Hide resolved
src/storage/types.rs Show resolved Hide resolved
Copy link
Member

@NishantJoshi00 NishantJoshi00 left a comment

Choose a reason for hiding this comment

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

LGTM

src/storage.rs Outdated Show resolved Hide resolved
@NishantJoshi00 NishantJoshi00 merged commit bf57a3c into main Feb 7, 2024
3 checks passed
@NishantJoshi00 NishantJoshi00 deleted the add-fingerprint-table branch February 7, 2024 14:22
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

Successfully merging this pull request may close these issues.

Creating Fingerprint Table and corresponding db interface
3 participants