Socket
Book a DemoInstallSign in
Socket

@particle/device-control-util

Package Overview
Dependencies
Maintainers
23
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@particle/device-control-util

Utility classes and functions for Node.js and browsers

latest
npmnpm
Version
1.1.3
Version published
Weekly downloads
152
533.33%
Maintainers
23
Weekly downloads
 
Created
Source

@particle/device-control-util

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

Installation

npm install @particle/device-control-util --save

API

areEqualArrays(arr1, arr2) ⇒ Boolean

Compare two array-like objects.

Kind: global function
Returns: Boolean - true if the arrays are equal or false otherwise.

ParamTypeDescription
arr1Array.<*>First array.
arr2Array.<*>Second array.

writeUint32Be(buf, val, [offs])

Write a 32-bit unsigned integer to a buffer (big-endian).

Kind: global function

ParamTypeDefaultDescription
bufUint8ArrayDestination buffer.
valNumberValue.
[offs]Number0Offset in the destination buffer.

writeUint32Le(buf, val, [offs])

Write a 32-bit unsigned integer to a buffer (little-endian).

Kind: global function

ParamTypeDefaultDescription
bufUint8ArrayDestination buffer.
valNumberValue.
[offs]Number0Offset in the destination buffer.

writeUint16Be(buf, val, [offs])

Write a 16-bit unsigned integer to a buffer (big-endian).

Kind: global function

ParamTypeDefaultDescription
bufUint8ArrayDestination buffer.
valNumberValue.
[offs]Number0Offset in the destination buffer.

writeUint16Le(buf, val, [offs])

Write a 16-bit unsigned integer to a buffer (little-endian).

Kind: global function

ParamTypeDefaultDescription
bufUint8ArrayDestination buffer.
valNumberValue.
[offs]Number0Offset in the destination buffer.

writeUint8(buf, val, [offs])

Write an 8-bit unsigned integer to a buffer.

Kind: global function

ParamTypeDefaultDescription
bufUint8ArrayDestination buffer.
valNumberValue.
[offs]Number0Offset in the destination buffer.

readUint32Be(buf, [offs]) ⇒ Number

Read a 32-bit unsigned integer from a buffer (big-endian).

Kind: global function
Returns: Number - Value.

ParamTypeDefaultDescription
bufUint8ArraySource buffer.
[offs]Number0Offset in the source buffer.

readUint32Le(buf, [offs]) ⇒ Number

Read a 32-bit unsigned integer from a buffer (little-endian).

Kind: global function
Returns: Number - Value.

ParamTypeDefaultDescription
bufUint8ArraySource buffer.
[offs]Number0Offset in the source buffer.

readUint16Be(buf, [offs]) ⇒ Number

Read a 16-bit unsigned integer from a buffer (big-endian).

Kind: global function
Returns: Number - Value.

ParamTypeDefaultDescription
bufUint8ArraySource buffer.
[offs]Number0Offset in the source buffer.

readUint16Le(buf, [offs]) ⇒ Number

Read a 16-bit unsigned integer from a buffer (little-endian).

Kind: global function
Returns: Number - Value.

ParamTypeDefaultDescription
bufUint8ArraySource buffer.
[offs]Number0Offset in the source buffer.

readUint8(buf, [offs]) ⇒ Number

Read an 8-bit unsigned integer from a buffer.

Kind: global function
Returns: Number - Value.

ParamTypeDefaultDescription
bufUint8ArraySource buffer.
[offs]Number0Offset in the source buffer.

toUint8Array(val) ⇒ Uint8Array

Convert a value to a Uint8Array.

Kind: global function

ParamTypeDescription
val*Value to convert.

concatUint8Arrays(...arrs) ⇒ Uint8Array

Concatenate a number of Uint8Array objects.

Kind: global function

ParamTypeDescription
...arrsUint8ArrayArrays to concatenate.

NOTE: Unfortunately, docs have a nasty habit of falling out of date. When in doubt, check usage in tests

FAQs

Package last updated on 10 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts