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

[hma] Add hash compare endpoint #1650

Merged
merged 1 commit into from
Oct 3, 2024
Merged

[hma] Add hash compare endpoint #1650

merged 1 commit into from
Oct 3, 2024

Conversation

dougneal
Copy link
Contributor

@dougneal dougneal commented Oct 3, 2024

Summary

Add the new API endpoint for getting the comparison/match distance between two hashes. Supports multiple hash types in one call.

Test Plan

dougneal@dougneal-mbp ~/T/hasher-matcher-actioner> curl -XPOST -H 'Content-Type: application/json' --data-binary @compare_this_2.json http://localhost:5000/m/compare
{
  "pdq": [
    true,
    {
      "distance": 9
    }
  ]
}

JSON input is:

{
    "pdq": [
        "facd8bcb2a49bcebdec1985298d5fe84bcd006c187c598c720c3c087b3fdb318",
        "facd8bcb2a49bcebdec1985228d5ae84bcd006c187c598c720c2b087b3fdb318"
    ]
}

And:

$ pytest src

@dougneal dougneal merged commit ff9381d into main Oct 3, 2024
5 checks passed
@dougneal dougneal deleted the add-hash-compare-endpoint branch October 3, 2024 14:45
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.

3 participants