You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, Bitset.js has two static functions BitSet.fromHexString and BitSet.fromBinaryString. Currently there is no option for an arbitrary base, but I think it would be a nice addition. Maybe something like BitSet.fromString(str, base)`, what do you think?
Constructor, static function, I am easy either way.. ❤️
I was just looking through your parse(P, val) to see if it was possible.. I got a little confused by the len = 8 for hexidecimal part, so I was unsure what would be needed for passing in 36 or even arbitrary lengths..
The len is just max block length, that is cut out at each time. For base 2 it's 32, for 16 it's 8, for a general base b it would be Math.log(2**32) / Math.log(b). However, this only makes sense for 2^k-bases with the current implementation. And I think implementing a static function is much cleaner, instead of coming up with an arbitrary prefix, such as 36:XYZ or something.
Hello, For input, you have
0b101010101010
and0xa6e
etc etc..You have the ability to do
const b36 = BitSet('10101010110101010101010101010').toString(36)
But not sure how to get it back in
const bs = BitSet(b36)
I am sure you are gonna say it's not possible.. but I just wanted to confirm that something like
BitSet(b36, 36)
didn't exist?The text was updated successfully, but these errors were encountered: