Skip to content

Commit

Permalink
Update ExtendedBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mhabedinpour committed Nov 14, 2017
1 parent fa33e24 commit a37a998
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "has-node",
"version": "0.2.7",
"version": "0.2.8",
"description": "Homekit Accessory Server",
"main": "app.js",
"scripts": {
Expand Down
9 changes: 2 additions & 7 deletions src/TCP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,9 @@ export default class TCP extends EventEmitter {
* @param framesCounter
*/
private createNonce(framesCounter: number): Buffer {
// Return native buffer
// The new version of the library significantly improved performance, and the library is covered with tests
return (new ExtendedBuffer({
maxBufferLength: 12
}))
.writeBuffer(Buffer.alloc(4))
.writeUIntLE(framesCounter, 8)
.readBuffer(12, true);
maxBufferLength: 12
})).writeBuffer(Buffer.alloc(4)).writeUIntLE(framesCounter, 8).readBuffer(12, true);
}

/**
Expand Down

0 comments on commit a37a998

Please sign in to comment.