# @particle/device-control-util

> Utility classes and functions for Node.js and browsers

Latest version **1.1.3** (published 2025-09-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @particle/device-control-util
pnpm add @particle/device-control-util
yarn add @particle/device-control-util
bun add @particle/device-control-util
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2025-09-10 |
| First published | 2022-02-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 23.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Particle Industries, Inc. |
| Maintainers | particlebot, no1089, carlos.hdez, guohui, keeramis5, monkbroc, mstan, sergeuz, avtolstoy, mlauer, wraithan, azenk, bwalach, rickkas7, mrlambchop_particle, hugo.montero, mphsi, pedrosordo, cole-abbeduto-particle, sbrust, eugene_particle, mohitparticle, karlag |

## Links

- npm: https://www.npmjs.com/package/@particle/device-control-util
- npm.io page: https://npm.io/package/@particle/device-control-util

## Recent versions

- 1.1.3 (latest) — 2025-09-10
- 1.1.2 — 2022-08-09
- 1.1.1 — 2022-02-17
- 1.1.0 — 2022-02-09

## README

# @particle/device-control-util

Utility classes and functions used by other packages in this repository.


## Installation

```shell
npm install @particle/device-control-util --save
```
<!-- private-module-note-start -->

<!-- private-module-note-end -->

## API
<!-- api-docs-start -->
<a name="areEqualArrays"></a>

### areEqualArrays(arr1, arr2) ⇒ <code>Boolean</code>
Compare two array-like objects.

**Kind**: global function  
**Returns**: <code>Boolean</code> - `true` if the arrays are equal or `false` otherwise.  

| Param | Type | Description |
| --- | --- | --- |
| arr1 | <code>Array.&lt;\*&gt;</code> | First array. |
| arr2 | <code>Array.&lt;\*&gt;</code> | Second array. |


* * *

<a name="writeUint32Be"></a>

### writeUint32Be(buf, val, [offs])
Write a 32-bit unsigned integer to a buffer (big-endian).

**Kind**: global function  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Destination buffer. |
| val | <code>Number</code> |  | Value. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the destination buffer. |


* * *

<a name="writeUint32Le"></a>

### writeUint32Le(buf, val, [offs])
Write a 32-bit unsigned integer to a buffer (little-endian).

**Kind**: global function  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Destination buffer. |
| val | <code>Number</code> |  | Value. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the destination buffer. |


* * *

<a name="writeUint16Be"></a>

### writeUint16Be(buf, val, [offs])
Write a 16-bit unsigned integer to a buffer (big-endian).

**Kind**: global function  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Destination buffer. |
| val | <code>Number</code> |  | Value. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the destination buffer. |


* * *

<a name="writeUint16Le"></a>

### writeUint16Le(buf, val, [offs])
Write a 16-bit unsigned integer to a buffer (little-endian).

**Kind**: global function  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Destination buffer. |
| val | <code>Number</code> |  | Value. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the destination buffer. |


* * *

<a name="writeUint8"></a>

### writeUint8(buf, val, [offs])
Write an 8-bit unsigned integer to a buffer.

**Kind**: global function  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Destination buffer. |
| val | <code>Number</code> |  | Value. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the destination buffer. |


* * *

<a name="readUint32Be"></a>

### readUint32Be(buf, [offs]) ⇒ <code>Number</code>
Read a 32-bit unsigned integer from a buffer (big-endian).

**Kind**: global function  
**Returns**: <code>Number</code> - Value.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Source buffer. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the source buffer. |


* * *

<a name="readUint32Le"></a>

### readUint32Le(buf, [offs]) ⇒ <code>Number</code>
Read a 32-bit unsigned integer from a buffer (little-endian).

**Kind**: global function  
**Returns**: <code>Number</code> - Value.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Source buffer. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the source buffer. |


* * *

<a name="readUint16Be"></a>

### readUint16Be(buf, [offs]) ⇒ <code>Number</code>
Read a 16-bit unsigned integer from a buffer (big-endian).

**Kind**: global function  
**Returns**: <code>Number</code> - Value.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Source buffer. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the source buffer. |


* * *

<a name="readUint16Le"></a>

### readUint16Le(buf, [offs]) ⇒ <code>Number</code>
Read a 16-bit unsigned integer from a buffer (little-endian).

**Kind**: global function  
**Returns**: <code>Number</code> - Value.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Source buffer. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the source buffer. |


* * *

<a name="readUint8"></a>

### readUint8(buf, [offs]) ⇒ <code>Number</code>
Read an 8-bit unsigned integer from a buffer.

**Kind**: global function  
**Returns**: <code>Number</code> - Value.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| buf | <code>Uint8Array</code> |  | Source buffer. |
| [offs] | <code>Number</code> | <code>0</code> | Offset in the source buffer. |


* * *

<a name="toUint8Array"></a>

### toUint8Array(val) ⇒ <code>Uint8Array</code>
Convert a value to a `Uint8Array`.

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| val | <code>\*</code> | Value to convert. |


* * *

<a name="concatUint8Arrays"></a>

### concatUint8Arrays(...arrs) ⇒ <code>Uint8Array</code>
Concatenate a number of `Uint8Array` objects.

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| ...arrs | <code>Uint8Array</code> | Arrays to concatenate. |


* * *


<!-- api-docs-end -->

_NOTE: Unfortunately, docs have a nasty habit of falling out of date. When in doubt, check usage in [tests](./src/index.test.js)_

---
_Source: https://npm.io/package/@particle/device-control-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
