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

Use keyToInviteId from @mapeo/crypto #971

Open
3 tasks
EvanHahn opened this issue Nov 27, 2024 · 0 comments
Open
3 tasks

Use keyToInviteId from @mapeo/crypto #971

EvanHahn opened this issue Nov 27, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@EvanHahn
Copy link
Contributor

This is a low-priority issue.

We have a function that converts a project key to a project invite ID:

comapeo-core/src/utils.js

Lines 129 to 138 in e153b44

/**
* Generate an invite ID from a project key
* @param {Readonly<Buffer>} projectKey
* @returns {Buffer}
*/
export function projectKeyToProjectInviteId(projectKey) {
const result = Buffer.allocUnsafe(32)
sodium.crypto_generichash(result, PROJECT_INVITE_ID_SALT, projectKey)
return result
}

This function also exists in @mapeo/crypto (see digidem/mapeo-crypto#26). We should delete our function and use the one from @mapeo/crypto instead.

Checklist:

  • Release a new version of @mapeo/crypto
  • Update to it in this repo
  • Delete projectKeyToProjectInviteId from this repo, replace it with the keyToInviteId function from @mapeo/crypto
@EvanHahn EvanHahn added the good first issue Good for newcomers label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant