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

Option to build model using word hashes for model anonymity #11

Open
rudikershaw opened this issue Sep 26, 2021 · 1 comment
Open

Option to build model using word hashes for model anonymity #11

rudikershaw opened this issue Sep 26, 2021 · 1 comment
Assignees

Comments

@rudikershaw
Copy link
Owner

If your model contains user input it is possible that sensitive user information may make it into the model. If the model is exposed (for example in the browser) it may expose this information.

When creating a new WhichX objection, we should allow a configuration option to hash all words added to the model. This will also require that words are hashed during comparison so that they can effectively be compared.

  • Specify new configuration option to allow model hashing.
  • Check this configuration before adding to the model.
  • Check this configuration before classifying against the model.
@rudikershaw rudikershaw self-assigned this Sep 28, 2021
@rudikershaw rudikershaw added this to the 2.3.0 milestone Sep 28, 2021
@Sharcoux
Copy link

Sharcoux commented May 3, 2022

You can use this to hash words:

export const generateHash = (value: string) => {
  let h = 0
  for (let i = 0; i < value.length; i++) h = (Math.imul(31, h) + value.charCodeAt(i)) | 0
  return h.toString(36)
}

@rudikershaw rudikershaw removed this from the 2.3.0 milestone May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants