Skip to content

Commit

Permalink
Modify the project to utilize Buffer from globalThis instead of requi…
Browse files Browse the repository at this point in the history
…ring it. (#128)

* use buffer from globalThis

* upgrade github actions
  • Loading branch information
felipefdl authored May 7, 2024
1 parent a78af96 commit 2c3942d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand Down
1 change: 0 additions & 1 deletion src/lib/LoraPacket.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { reverseBuffer, asHexString } from "./util";
import { decrypt, decryptJoin, decryptFOpts } from "./crypto";
import { recalculateMIC } from "./mic";
import { Buffer } from "buffer";

enum MType {
JOIN_REQUEST = 0,
Expand Down
3 changes: 1 addition & 2 deletions src/lib/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import LoraPacket, { LorawanVersion } from "./LoraPacket";
import LoraPacket from "./LoraPacket";
import { reverseBuffer } from "./util";
import CryptoJS from "crypto-js";
import { Buffer } from "buffer";

const LORAIV = CryptoJS.enc.Hex.parse("00000000000000000000000000000000");

Expand Down
1 change: 0 additions & 1 deletion src/lib/mic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import LoraPacket, { LorawanVersion } from "./LoraPacket";
import { reverseBuffer } from "./util";

import { AesCmac } from "aes-cmac";
import { Buffer } from "buffer";

// calculate MIC from payload
function calculateMIC(
Expand Down

0 comments on commit 2c3942d

Please sign in to comment.