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

Encoding library that preserves alphabetical order #87

Closed
Tracked by #53 ...
jannden opened this issue Nov 8, 2024 · 2 comments · Fixed by #92
Closed
Tracked by #53 ...

Encoding library that preserves alphabetical order #87

jannden opened this issue Nov 8, 2024 · 2 comments · Fixed by #92
Assignees

Comments

@jannden
Copy link
Contributor

jannden commented Nov 8, 2024

Investigate and find an encoding library that preserves alphabetical order.
If such library was found, implement it.
Start with: https://github.com/hsivonen/encoding_rs

From here:

Since base64 would prevent us from ever using source APIs to sort incoming users instead of doing it on the application end, incurring pointless memory overhead, we should not use base64 encoding to do this, but instead an encoding scheme that does preserve alphabetical order. I'm not aware of any off the top of my head, but I am sure they exist. In the short term this is not essential, as we could migrate to a different encoding in the future, but we might as well pick a future proof encoding at this point.

@emgrav
Copy link
Member

emgrav commented Nov 8, 2024

encoding_rs

Is this the right crate for this? I think we want to use something like base32hex, one crate that provides an implementation of this is https://docs.rs/data-encoding/latest/data_encoding/index.html

@jannden
Copy link
Contributor Author

jannden commented Nov 11, 2024

@emgrav Yup, I believe you are pointing to the right direction.
I am wondering though why not to use just a simple hex encoding where we won't have to worry about padding.
I will create a WIP and do some tests to see how it works.

@jannden jannden linked a pull request Nov 12, 2024 that will close this issue
@jannden jannden closed this as completed Nov 14, 2024
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 a pull request may close this issue.

2 participants