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

Big endian vs little endian #4

Closed
ahdinosaur opened this issue Nov 27, 2023 · 0 comments · Fixed by #7
Closed

Big endian vs little endian #4

ahdinosaur opened this issue Nov 27, 2023 · 0 comments · Fixed by #7

Comments

@ahdinosaur
Copy link
Owner

Not sure whether to use big endian or little endian.

My understanding is most CPUs are LE (so LE is more efficient), but network protocols are "supposed to be" BE. https://developer.mozilla.org/en-US/docs/Glossary/Endianness

One idea is we use little endian for the incrementing nonce (used internally), and big endian for the content length (sent over the network). Little endian for the nonce helps make incrementing with libsodium easy, because libsodium provides a increment function which increments a little-endian buffer.

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.

1 participant