Add saltpack's baseX family of codecs #17

Open
opened 2016-02-04 14:44:46 -06:00 by jpetso · 0 comments
jpetso commented 2016-02-04 14:44:46 -06:00 (Migrated from github.com)

See https://saltpack.org/armoring for the specification. Should be a fun exercise as follow-up to adding Base85, since the calculation (and differences from currently implemented codecs) is largely the same.

It seems the alphabet and binary block size should be passed as template arguments.

For the calculation of encoded/decoded sizes, in case the current calculation isn't synonymous with their "most direct way to compute [it]", we could use log2() from https://github.com/elbeno/constexpr. I'll have to check whether it is synonymous.

For block sizes > 8 bytes, a bignum library will be necessary. I'm thinking we should probably statically assert in this case if included without an extra bignum library, and use a specialized template (that doesn't assert) otherwise. We can provide an extra header to provide that specialized template, avoiding to e.g. hardcode a boost dependency in the main header.

See https://saltpack.org/armoring for the specification. Should be a fun exercise as follow-up to adding Base85, since the calculation (and differences from currently implemented codecs) is largely the same. It seems the alphabet and binary block size should be passed as template arguments. For the calculation of encoded/decoded sizes, in case the current calculation isn't synonymous with their "most direct way to compute [it]", we could use `log2()` from https://github.com/elbeno/constexpr. I'll have to check whether it is synonymous. For block sizes > 8 bytes, a bignum library will be necessary. I'm thinking we should probably statically assert in this case if included without an extra bignum library, and use a specialized template (that doesn't assert) otherwise. We can provide an extra header to provide that specialized template, avoiding to e.g. hardcode a boost dependency in the main header.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-tplgy/cppcodec#17
No description provided.