Socket
Socket
Sign inDemoInstall

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 0.0.6 to 0.0.7

24

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

@@ -10,3 +10,4 @@ "main": "index.js",

"scripts": {
"test": "./node_modules/mocha/bin/mocha --timeout 5000 --reporter spec ./test/"
"test": "./node_modules/mocha/bin/mocha --timeout 5000 --reporter spec ./test/",
"webtest": "browserify test/max.js | testling -u"
},

@@ -27,4 +28,4 @@ "repository": {

"author": {
"name": "null_radix",
"email": "null_radix@riseup.net"
"name": "martin becze",
"email": "mjbecze@gmail.com"
},

@@ -37,4 +38,17 @@ "license": "GPL",

"mocha": "~1.17.1",
"bignum": "^0.7.0"
"bn.js": "*"
},
"testling": {
"files": "test/*.js",
"harness" : "mocha-bdd",
"browsers": [
"chrome/22..latest",
"firefox/16..latest",
"safari/latest",
"opera/11.0..latest",
"iphone/6",
"ipad/6",
"android-browser/latest"
]
}
}
var assert = require('assert');
var fs = require('fs');
var Bignum = require('bignum');
var Bignum = require('bn.js');
var RLP = require('../index.js');
var officalTests = require('./jsonTests/rlptest.json');

@@ -154,21 +155,14 @@ describe('RLP encoding (string):', function() {

describe('offical tests', function () {
var jsonTests;
before(function () {
var data = fs.readFileSync('./test/jsonTests/rlptest.json')
jsonTests = JSON.parse(data);
});
it('pass all tests', function (done) {
for (test in jsonTests) {
console.log(test);
for (var test in officalTests) {
var incoming = jsonTests[test].in
var incoming = officalTests[test].in ;
//if we are testing a big number
if(incoming[0] == '#'){
if(incoming[0] === '#'){
var bn = new Bignum(incoming.slice(1));
incoming = bn.toBuffer()
incoming = new Buffer(bn.toArray());
}
var encoded = RLP.encode(incoming);
assert.equal(encoded.toString('hex'), jsonTests[test].out.toLowerCase());
assert.equal(encoded.toString('hex'), officalTests[test].out.toLowerCase());
}

@@ -175,0 +169,0 @@ done();

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