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

Expose some protected members #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ugumba
Copy link

@ugumba ugumba commented Apr 24, 2020

  • Make internal algorithms protected so they can be used from derived classes.
  • Move LookupTable inside Base32Encoding to make this work without making it public - happy to make it public if you want.
  • Use Alphabet directly from GetOrCreateLookupTable() (optimization).

The story: I need to encode from/decode to a fixed number of bytes in a struct, not a byte[].
The cleanest way to make use of your excellent code was to interface with the 4 methods taking "byte *" as unencoded data.

Alternatively, if ToBase32Unsafe() and ToBytesUnsafe() took "byte *", I could interface with those 2 methods instead - but I felt that change was a bit more invasive, and would be less performant (in my code, lengths/groupCounts/remainders can be const).

Cheers!

…lasses.

Move LookupTable inside Base32Encoding to make this work without making it public.
@ugumba
Copy link
Author

ugumba commented Apr 24, 2020

By the way, if you'd rather not merge this, I respect that, but would appreciate to know early - so I can plan on using the fork.
Sticking with your nuget package would be the most convenient path for me, obviously!

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.

1 participant