multiformats / multiformats/rust-multibase
Make it no-alloc compatible
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 55
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
The data-encoding library is no_alloc compatible, you can use e.g. encode_mut.
We could provide a similar trait, which writes into a mutable slice.
Things to keep in mind:
- base-x currently needs
alloc. It's used for bases which are not power of two. - It increases the API surface, currently this library is pretty small, should we change that?
- Can we make it work without making this library hard to use when you don't need no_std and no-alloc compatibility?
- How would it relate to rust-cid? Could we follow the idea of rust-multihash and use GenericArray when converting into a certain Multibase? Given that we know the maximum digest size of the CID, we also know the possible maximum base encoded size at compile time. Can this be wrapped in a nice to use API?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked data-encoding encode_mut API and the base-x allocation requirement. Then compare the proposed approach with rust-cid, rust-multihash, and GenericArray. Done means the project has an agreed no-alloc design and a clearly scoped API, including how non-power-of-two bases are handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100