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

rlp

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rlp - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0

6

index.js

@@ -208,3 +208,7 @@ const assert = require('assert')

if (typeof v === 'string') {
v = new Buffer(padToEven(stripHexPrefix(v)), 'hex')
if (isHexPrefixed(v)) {
v = new Buffer(padToEven(stripHexPrefix(v)), 'hex')
} else {
v = new Buffer(v)
}
} else if (typeof v === 'number') {

@@ -211,0 +215,0 @@ if (!v) {

2

package.json
{
"name": "rlp",
"version": "1.1.2",
"version": "2.0.0",
"description": "Recursive Length Prefix Encoding Module",

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

@@ -18,3 +18,3 @@ const assert = require('assert')

it('should return itself if single byte and less than 0x7f:', function () {
var encodedSelf = RLP.encode(new Buffer('a'))
var encodedSelf = RLP.encode('a')
assert.equal(encodedSelf.toString(), 'a')

@@ -24,3 +24,3 @@ })

it('length of string 0-55 should return (0x80+len(data)) plus data', function () {
var encodedDog = RLP.encode(new Buffer('dog'))
var encodedDog = RLP.encode('dog')
assert.equal(4, encodedDog.length)

@@ -34,3 +34,3 @@ assert.equal(encodedDog[0], 131)

it('length of string >55 should return 0xb7+len(len(data)) plus len(data) plus data', function () {
var encodedLongString = RLP.encode(new Buffer('zoo255zoo255zzzzzzzzzzzzssssssssssssssssssssssssssssssssssssssssssssss'))
var encodedLongString = RLP.encode('zoo255zoo255zzzzzzzzzzzzssssssssssssssssssssssssssssssssssssssssssssss')
assert.equal(72, encodedLongString.length)

@@ -47,3 +47,3 @@ assert.equal(encodedLongString[0], 184)

it('length of list 0-55 should return (0xc0+len(data)) plus data', function () {
var encodedArrayOfStrings = RLP.encode([new Buffer('dog'), new Buffer('god'), new Buffer('cat')])
var encodedArrayOfStrings = RLP.encode(['dog', 'god', 'cat'])
assert.equal(13, encodedArrayOfStrings.length)

@@ -135,8 +135,4 @@ assert.equal(encodedArrayOfStrings[0], 204)

var bufString = testString.map(function (i) {
return new Buffer(i)
})
it('should encode it', function () {
encoded = RLP.encode(bufString)
encoded = RLP.encode(testString)
})

@@ -267,3 +263,3 @@

var b = RLP.encode('88f')
assert.equal(a.toString('hex'), b.toString('hex'))
assert.notEqual(a.toString('hex'), b.toString('hex'))
})

@@ -270,0 +266,0 @@ })

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