@openrfid/utils 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://raw.githubusercontent.com/rfidsoftwares/openrfid-simulator/main/assets/logo.svg" alt="OpenRFID Simulator Logo" width="180" />
|
|
4
|
+
|
|
5
|
+
# `@openrfid/utils`
|
|
6
|
+
|
|
7
|
+
### Math Probability Distributions, Network Helpers, & Bitwise Utilities
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@openrfid/utils)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://rfidsoftwares.com)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🚀 Overview
|
|
18
|
+
|
|
19
|
+
`@openrfid/utils` provides shared mathematical algorithms, statistical probability distributions (Gaussian, Uniform, Exponential), RSSI signal loss calculators, bitwise padding, and network address validation helpers for **OpenRFID Simulator**.
|
|
20
|
+
|
|
21
|
+
Developed & Maintained by **[RFID Software India Private Limited](https://rfidsoftwares.com)**.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 📦 Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# npm
|
|
29
|
+
npm install @openrfid/utils
|
|
30
|
+
|
|
31
|
+
# pnpm
|
|
32
|
+
pnpm add @openrfid/utils
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 💻 Code Example
|
|
38
|
+
|
|
39
|
+
### 1. Gaussian RSSI Signal Noise Generator
|
|
40
|
+
```typescript
|
|
41
|
+
import { generateGaussianNoise, hexToBinary, binaryToHex } from '@openrfid/utils';
|
|
42
|
+
|
|
43
|
+
// Generate simulated RSSI noise around mean of -55 dBm (stdDev = 3.5)
|
|
44
|
+
const simulatedRssi = generateGaussianNoise({ mean: -55.0, stdDev: 3.5 });
|
|
45
|
+
console.log(`Calculated RSSI: ${simulatedRssi.toFixed(2)} dBm`);
|
|
46
|
+
|
|
47
|
+
// Bitwise Conversions
|
|
48
|
+
const binary = hexToBinary('3034');
|
|
49
|
+
console.log('Binary:', binary); // "0011000000110100"
|
|
50
|
+
const hex = binaryToHex(binary);
|
|
51
|
+
console.log('Hex:', hex); // "3034"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 🌐 Monorepo Ecosystem
|
|
57
|
+
|
|
58
|
+
| Package | Description |
|
|
59
|
+
| :--- | :--- |
|
|
60
|
+
| [`@openrfid/core`](https://www.npmjs.com/package/@openrfid/core) | Core EventBus, Config, & SQLite persistence |
|
|
61
|
+
| [`@openrfid/epc`](https://www.npmjs.com/package/@openrfid/epc) | Bit-level EPC Gen2 memory bank encoders/decoders |
|
|
62
|
+
| [`@openrfid/simulator`](https://www.npmjs.com/package/@openrfid/simulator) | High-throughput inventory simulation engine |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 📄 License & Corporate Support
|
|
67
|
+
|
|
68
|
+
Licensed under the **MIT License**.
|
|
69
|
+
Brought to you by **RFID Software India Private Limited**.
|
|
70
|
+
For enterprise RFID middleware, hardware drivers, or custom protocol plugins, visit **[rfidsoftwares.com](https://rfidsoftwares.com)**.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrfid/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Shared simulation utilities, random distribution generators, data format parsers, and network validators.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
17
18
|
],
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"tsup": "^8.0.2",
|