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

Support for unsigned integers #16

Open
koryphaee opened this issue Nov 4, 2024 · 1 comment
Open

Support for unsigned integers #16

koryphaee opened this issue Nov 4, 2024 · 1 comment

Comments

@koryphaee
Copy link

koryphaee commented Nov 4, 2024

I am currently working on a project that uses a ulong as a central type in the business logic. It represents a 64bit image hash that needs to be saved in the database as well as queried via JSON API.
I am already using this cool library for my database primary keys but can't use if for the hash yet. Using long as the backing type would technically work but it doesn't feel clean.

From what I can tell it won't be a lot of work and I will try to create the PR myself. Even though I only need ulong I would add all missing unsigned types since the overhead is minimal. These would be:

StronglyType keyword
SignedByte sbyte
UnsignedShort ushort
UnsignedInt uint
UnsignedLong ulong
NativeUnsignedInt nuint

(taken from https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#characteristics-of-the-integral-types)

I also need XOR support to calculate the hamming distance between two hashes but this will be a separate issue: #17

@koryphaee
Copy link
Author

PR is done: #18

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

No branches or pull requests

1 participant