Socket
Socket
Sign inDemoInstall

coap-packet

Package Overview
Dependencies
0
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.2 to 0.1.3

7

index.js

@@ -34,8 +34,13 @@

, i
, length
packet = fillGenDefaults(packet)
options = prepareOptions(packet)
length = calculateLength(packet, options)
buffer = new Buffer(calculateLength(packet, options))
if (length > 1280)
throw new Error('Max packet size is 1280: current is ' + length)
buffer = new Buffer(length)
// first byte

@@ -42,0 +47,0 @@ byte = 0

2

package.json
{
"name": "coap-packet",
"version": "0.1.2",
"version": "0.1.3",
"description": "Generate and Parse CoAP packets",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -20,4 +20,6 @@ CoAP-Packet

This has been tested only on node v0.8.
**CoAP-packet** is an **OPEN Open Source Project**, see the <a href="#contributing">Contributing</a> section to find out what this means.
This has been tested only on node v0.10.
## Installation

@@ -63,2 +65,3 @@

<a name="parse"></a>
### parse(buffer)

@@ -69,2 +72,3 @@

<a name="generate"></a>
### generate()

@@ -76,2 +80,3 @@

<a name="format"></a>
### JS packet format

@@ -99,2 +104,11 @@

<a name="contributing"></a>
## Contributing
__CoAP-Packet__ is an **OPEN Open Source Project**. This means that:
> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
See the [CONTRIBUTING.md](https://github.com/mcollina/coap-packet/blob/master/CONTRIBUTING.md) file for more details.
## Contributors

@@ -101,0 +115,0 @@

@@ -676,6 +676,5 @@

it('should generate a payload', function() {
payload = new Buffer(42)
buffer = generate({ payload: payload })
expect(buffer.slice(5)).to.eql(payload)
it('should error if the resulting message is greater than 1280', function() {
payload = new Buffer(1280 - 4) // the basic headers are 4
expect(generate.bind(null, { payload: payload })).to.throw('Max packet size is 1280: current is 1281')
})

@@ -682,0 +681,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc