File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change 1- # node.js-byte-flag-calculator
2- byte flag calculator for javascript
1+ # node.js-bytes-calculator
2+ abstract and easy way how to work with bytes in JS
3+
4+ ## software requirements
5+ * node.js v6.9+ [ with v8 enabled]
6+ * npm v3+
7+
8+ ## used technologies
9+ * jest
10+
11+ ## how to execute tests
12+ ` npm test `
13+ to execute tests with coverage
14+ ` npm test -- --coverage `
15+
16+ ## how to use
17+ ` import calc from "node-bytes-calculator"; ` or ` const calc = require("node-bytes-calculator"); `
18+
19+ ```
20+ calc.hasBytes(0xff, 0x0f) -> return true as 0xff contains 0x0f bytes
21+ calc.hasBytes(0x02, 0x08) -> retuns false as 0x02 do not contains 0x08 bytes
22+
23+ calc.addBytes(0x02, 0x02) -> returns 0x02
24+ calc.addBytes(0x01, 0x02) -> returns 0x03
25+
26+ calc.removeBytes(0x00, 0x01) -> returns 0x00 as there where no bytes
27+ calc.removeBytes(0x06, 0x02) -> returns 0x04 as 0x02 bytes been delete removed from 0x06
28+ calc.removeBytes(0x02, 0x06) -> returns 0x02 as 0x06 bytes wasn't presented in 0x02
29+ ```
You can’t perform that action at this time.
0 commit comments