Comments (6)
The constructor currently takes a length. Would passing an array of bytes assume the the length of the array, with appropriate adjustment made for 16 or 32 bit ints?
That strawman for specifying length doesn't seem unreasonable to me.
from bitwriter.
in my case, I'm writing against a graphics board that has different word lengths: header can include 8bit commands and 16bit commands like x and y.
it would be nice to be able to commingle those in the constructor.
I'd whip up some code but I'm on my way to the zoo for the day :)
from bitwriter.
Rad, enjoy the zoo!
Just to make sure I implement what you're asking for:
var buf = new BitWriter([ 1, 2, 64738, 23 ]);
Would basically be convenience for
var buf = new BitWriter(5);
buf
.write(1)
.write(2)
.write(64738)
.write(23);
and
var buf = new BitWriter([ 1, 2, 64738, { value: 23, width: 16 } ]);
would be
var buf = new BitWriter(6);
buf
.write(1)
.write(2)
.write(64738)
.write(23, { size: 16 });
from bitwriter.
that's exactly what I am after.
from bitwriter.
Done & published!
$ npm install [email protected]
from bitwriter.
awesome! on it in the morning to try it out! thank you very much!
from bitwriter.
Related Issues (2)
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 bitwriter.