Skip to content

Expose some protected members#15

Open
ugumba wants to merge 1 commit intowiry-net:masterfrom
ugumba:feature/exposeInnards
Open

Expose some protected members#15
ugumba wants to merge 1 commit intowiry-net:masterfrom
ugumba:feature/exposeInnards

Conversation

@ugumba
Copy link
Copy Markdown

@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
Copy Markdown
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