Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hiqnet

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hiqnet - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

lib/HiQnet.d.ts

6

package.json
{
"name": "hiqnet",
"version": "0.0.4",
"version": "0.0.5",
"description": "Parsing library for HiQnet communication protocol",
"main": "./dist/HiQnet.js",
"types": "./dist/HiQnet.d.ts",
"main": "./lib/HiQnet.js",
"types": "./lib/HiQnet.d.ts",
"scripts": {

@@ -8,0 +8,0 @@ "start": "tsc --watch",

@@ -18,8 +18,9 @@ [![platform](https://img.shields.io/badge/platform-node.js-green)](https://nodejs.org/en)

| Version | Release Notes |
| :-----: | --------------------------------- |
| 0.0.4 | Package publishing automation |
| 0.0.3 | Fixed missing .js and .d.ts files |
| 0.0.2 | Fixed broken links in readme |
| 0.0.1 | Initial beta release |
| Version | Release Notes |
| :-----: | -------------------------------------------------- |
| 0.0.5 | Fixed: github actions not publishing .js and .d.ts |
| 0.0.4 | Package publishing automation |
| 0.0.3 | Fixed missing .js and .d.ts files |
| 0.0.2 | Fixed broken links in readme |
| 0.0.1 | Initial beta release |

@@ -26,0 +27,0 @@ ## Usage

const assert = require('assert');
const bssLib = require('../dist/HiQnet');
const hiqnet = require('../lib/HiQnet');

@@ -8,3 +8,3 @@

it('<buffer 01 02 03 04 05 06> should return <buffer 07>', function () {
var actual = bssLib.calculateChecksum(Buffer.from([0x01, 0x02, 0x03, 0x04, 0x05, 0x06]));
var actual = hiqnet.calculateChecksum(Buffer.from([0x01, 0x02, 0x03, 0x04, 0x05, 0x06]));
var expected = Buffer.from([0x07]);

@@ -16,3 +16,3 @@ assert.deepEqual(actual, expected);

it('<buffer 02 03 06 15 1b> should return <buffer 1b 82 1b 83 1b 86 1b 95 1b 9b>', function () {
var actual = bssLib.byteSubstitute(Buffer.from([0x02, 0x03, 0x06, 0x15, 0x1b]));
var actual = hiqnet.byteSubstitute(Buffer.from([0x02, 0x03, 0x06, 0x15, 0x1b]));
var expected = Buffer.from([0x1b, 0x82, 0x1b, 0x83, 0x1b, 0x86, 0x1b, 0x95, 0x1b, 0x9b]);

@@ -24,3 +24,3 @@ assert.deepEqual(actual, expected);

it('<buffer 1b 82 1b 83 1b 86 1b 95 1b 9b> should return <buffer 02 03 06 15 1b>', function () {
var actual = bssLib.byteUnsubstitute(Buffer.from([0x1b, 0x82, 0x1b, 0x83, 0x1b, 0x86, 0x1b, 0x95, 0x1b, 0x9b]));
var actual = hiqnet.byteUnsubstitute(Buffer.from([0x1b, 0x82, 0x1b, 0x83, 0x1b, 0x86, 0x1b, 0x95, 0x1b, 0x9b]));
var expected = Buffer.from([0x02, 0x03, 0x06, 0x15, 0x1b]);

@@ -33,3 +33,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.encapsulateCommand(Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]));
var actual = hiqnet.encapsulateCommand(Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]));
var expected = Buffer.from([0x02, 0x8d, 0x10, 0x1b, 0x82, 0x1b, 0x83, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff, 0xd1, 0x03]);

@@ -42,3 +42,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.decapsulateCommand(Buffer.from([0x02, 0x8d, 0x10, 0x1b, 0x82, 0x1b, 0x83, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff, 0xd1, 0x03]));
var actual = hiqnet.decapsulateCommand(Buffer.from([0x02, 0x8d, 0x10, 0x1b, 0x82, 0x1b, 0x83, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff, 0xd1, 0x03]));
var expected = Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]);

@@ -51,3 +51,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.getCommandIdBuffer(Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]));
var actual = hiqnet.getCommandIdBuffer(Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]));
var expected = Buffer.from([0x8d]);

@@ -60,3 +60,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.getAddressBuffer(Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]));
var actual = hiqnet.getAddressBuffer(Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]));
var expected = Buffer.from([0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60]);

@@ -69,3 +69,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.getDataBuffer(Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]));
var actual = hiqnet.getDataBuffer(Buffer.from([0x8d, 0x10, 0x02, 0x03, 0x00, 0x01, 0x0f, 0x00, 0x60, 0x00, 0x34, 0xe8, 0xff]));
var expected = Buffer.from([0x00, 0x34, 0xe8, 0xff]);

@@ -78,3 +78,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.encDiscrete(10);
var actual = hiqnet.encDiscrete(10);
var expected = Buffer.from([0x00, 0x00, 0x00, 0x0a]);

@@ -87,3 +87,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.decDiscrete(Buffer.from([0x00, 0x00, 0x00, 0x0b]));
var actual = hiqnet.decDiscrete(Buffer.from([0x00, 0x00, 0x00, 0x0b]));
var expected = 11;

@@ -96,3 +96,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.encPercent(12.5);
var actual = hiqnet.encPercent(12.5);
var expected = Buffer.from([0x00, 0x0c, 0x80, 0x00]);

@@ -105,3 +105,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.decPercent(Buffer.from([0x00, 0x0c, 0x80, 0x00]));
var actual = hiqnet.decPercent(Buffer.from([0x00, 0x0c, 0x80, 0x00]));
var expected = 12.5;

@@ -114,3 +114,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.encGain(-15);
var actual = hiqnet.encGain(-15);
var expected = Buffer.from([0xff, 0xfd, 0xef, 0xce]);

@@ -123,3 +123,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.decGain(Buffer.from([0xff, 0xfd, 0xef, 0xce]));
var actual = hiqnet.decGain(Buffer.from([0xff, 0xfd, 0xef, 0xce]));
var expected = -14.999956513820392;

@@ -132,3 +132,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.encScalarLinear(5);
var actual = hiqnet.encScalarLinear(5);
var expected = Buffer.from([0x00, 0x00, 0xc3, 0x50]);

@@ -141,3 +141,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.decScalarLinear(Buffer.from([0x00, 0x00, 0xc3, 0x50]));
var actual = hiqnet.decScalarLinear(Buffer.from([0x00, 0x00, 0xc3, 0x50]));
var expected = 5;

@@ -150,3 +150,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.encDelay(5);
var actual = hiqnet.encDelay(5);
var expected = Buffer.from([0x00, 0x00, 0x01, 0xe0]);

@@ -159,3 +159,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.decDelay(Buffer.from([0x00, 0x00, 0x01, 0xe0]));
var actual = hiqnet.decDelay(Buffer.from([0x00, 0x00, 0x01, 0xe0]));
var expected = 5;

@@ -168,3 +168,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.encFrequencyOrSpeed(5);
var actual = hiqnet.encFrequencyOrSpeed(5);
var expected = Buffer.from([0x00, 0x0a, 0xaa, 0x5a]);

@@ -177,3 +177,3 @@ assert.deepEqual(actual, expected);

function () {
var actual = bssLib.decFrequencyOrSpeed(Buffer.from([0x00, 0x0a, 0xaa, 0x5a]));
var actual = hiqnet.decFrequencyOrSpeed(Buffer.from([0x00, 0x0a, 0xaa, 0x5a]));
var expected = 4.999999950079738;

@@ -180,0 +180,0 @@ assert.deepEqual(actual, expected);

@@ -6,3 +6,3 @@ {

"declaration": true,
"outDir": "./dist"
"outDir": "./lib"
},

@@ -9,0 +9,0 @@ "include": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc