multiformats / multiformats/js-multiformats
block.bytes can be a nodejs Buffer
Open
@rvagg is already working on this.
Since Jul 26, 2022.
P2
- Dominant language
- TypeScript
- Stars
- 268
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
Would like to know if this is the desired behavior:
Block = await import('multiformats/block')
codec = await import('@ipld/dag-cbor')
{ sha256: hasher } = await import('multiformats/hashes/sha2')
bytes = Buffer.from([ 100, 97, 115, 100, 102 ])
block = await Block.decode({ bytes, codec, hasher })
block.bytes instanceof Buffer // true
Noticed this while testing with the ipfs block api in node. Buffer extends Uint8Array which is great, but it seems to override some of the characteristics of Uint8Array.
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.
Assessment
This issue has not been assessed yet.