Tokens are generated differently #19
jessepeterson
started this conversation in
Technical
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For both the Tokens and Declaration Items endpoints we generate the tokens by iteratively building and hashing them within Go. However ServerTokens for the Declarations themselves are all stored and managed in MySQL. This dichotomy of different approaches is a little odd. This was done to reduce complexity in the storage backend as well as to try and reduce race conditions in MySQL by avoiding a separate query using, say,
GROUP_CONCAT()
to hash the individual declaration tokens. As well we wanted it to be really fast. So we use a non-cryptographic hashing function calledxxhash
. This may not have been a good approach by splitting these.Beta Was this translation helpful? Give feedback.
All reactions