bitwisejs and word state manipulations
|
3 years ago | |
---|---|---|
src | 3 years ago | |
tests | 3 years ago | |
.eslintrc.json | 3 years ago | |
.gitignore | 3 years ago | |
README.md | 3 years ago | |
package-lock.json | 3 years ago | |
package.json | 3 years ago |
Is a CommonJs Es6 module to manipulate bits.
Because numeric values are default coded as floating-point in 64-bit format IEEE-754 \Ö/, unexpected results can popup while bitwise operations.
In order to operate, Number(s), I mean the integer part is stored in a 52 bits matissa.
Max integer value is 2^53 and min -2^53, read stackoverflow.
To raise this kind of caveat, ArrayBuffer usage is highly recommended to isolate bytes state before processing.
This may be used to build state machine or other stuffs...bitwise based.
npm i
To run Mocha test suite :
npm test
Sample to integrate beta release
npm i https://gogs.pier-infor.fr/pf.pier-infor.fr/bitwisejs/archive/1.0.0.tar.gz --save
Replacing 'numberValue' by the value of the number. Get a bin view :
echo "obase=2;'numberValue'" | bc
Get an hex view :
echo "obase=16;'numberValue'" | bc
npm run lint