Comments (3)
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?
from bitset.js.
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..
from bitset.js.
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.
from bitset.js.
Related Issues (20)
- If the data is completely zero, then count leading zeros and count trailing zeros should return the word size HOT 9
- Why is isEmpty false even when all bits are set to 0? HOT 3
- New Functions HOT 5
- Webpack compatible version HOT 8
- Q: TypeScript Definition file? HOT 4
- Misleading comments on [im]mutable functions HOT 2
- [Question] Optimized for large ranges of the same value? HOT 3
- Array parser HOT 2
- Memory usage HOT 10
- A `size()` method HOT 3
- The typescript type declaration does not match the structure of the actual module
- Symbol.iterator is missing from the TypeScript types
- Shifts
- iterator: syntax error in IE HOT 9
- As we can construct a bitset object by a Buffer, Can we convert the bitset to Buffer HOT 4
- How to use this most efficiently? HOT 3
- Unexpected Results HOT 2
- Documentation problem with "set" function HOT 1
- Benchmarks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitset.js.