Skip to content

Fix encoding & decoding large unsigned u32 & u16 ints in MSSQL. #15

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

saltymango2619
Copy link

Fixes #14.

As it stands now, it will still die when trying to decode a super big i64 that's trying to be reinterpreted as a u64. Since MSSQL doesn't really have unsigned types, I don't care about that edge case personally, I'm just going to leave it as that.

If someone really wants it, I guess they can just copy the Decode implementation for i64 and swap out the primitive when calling from_le_bytes.

Ok(i64::from_le_bytes(buf))

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 this pull request may close these issues.

Can't decode as large u32
1 participant