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

encode applies to buffers #7

Open
swiing opened this issue May 30, 2022 · 0 comments
Open

encode applies to buffers #7

swiing opened this issue May 30, 2022 · 0 comments

Comments

@swiing
Copy link
Owner

swiing commented May 30, 2022

encode/decode are not features of BitArray. Instead, they are features of ArrayBuffers.

In the current main branch, encode exposes the internals of the BitArray implementation: should we, for whatever reason in the future, want to use buffers of length multiple of 1, or multiple of 8 (or whatever different than today), this would be a breaking change to the encoding, which is undesirable.

The thing is that we are not actually encoding/decoding bit arrays, but rather the buffer bound to the array. So let's be clear about that, and move the encode/decode away from the BitArray.

Note 1: this issue elaborates on #1.
Note 2: in order to implement, it may help to allow instantiating a bit array, given a buffer (back to square 1!).

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

No branches or pull requests

1 participant