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

rlp

Package Overview
Dependencies
Maintainers
3
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 2.1.0 to 2.2.0

dist/index.d.ts

51

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
(modification: no type change headlines) and this project adheres to
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
(modification: no type change headlines) and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [v2.2.0] - 2018-12-17
First `TypeScript` based release of `EthereumJS` libraries, thanks @krzkaczor,
@GrandSchtroumpf, @whymarrh, @holgerd77 for the great work on this!
This release doesn't introduce any main new features but will serve as a basis
for further `TypeScript` transitions coming along with greater type safety
for `EthereumJS` libraries. If you are developing in `TypeScript` you can
further already benefit from the `RLP` type declarations published from now on
along new releases.
See PR [#37](https://github.com/ethereumjs/rlp/pull/37) and subsequent PRs merged
towards the associated `typescript` branch to get an overview on the changes.
The release also comes along with the introduction of a new repo
[ethereumjs-config](https://github.com/ethereumjs/ethereumjs-config) centralizing
configuration for `EthereumJS` libraries on `TypeScript` itself as well as
linting, formatting and testing.
This release passes all existing unit tests and other checks. If you nevertheless
experience problems please report on the `EthereumJS`
[Gitter](https://gitter.im/ethereum/ethereumjs) channel.
Other changes:
- Added `LICENSE` file for `MPL2.0`, see PR [#31](https://github.com/ethereumjs/rlp/pull/31)
[v2.2.0]: https://github.com/ethereumjs/rlp/compare/2.1.0...v2.2.0
## [v2.1.0] - 2018-06-28
- Updated supported Node versions, PR [#13](https://github.com/ethereumjs/rlp/pull/13)
- Switched to ``safe-buffer`` for backwards compatibility, PR [#18](https://github.com/ethereumjs/rlp/pull/18)
- Switched to `safe-buffer` for backwards compatibility, PR [#18](https://github.com/ethereumjs/rlp/pull/18)
- Increased test coverage, PR [#22](https://github.com/ethereumjs/rlp/pull/22)

@@ -20,7 +49,9 @@ - Example code tweaks, PR [#12](https://github.com/ethereumjs/rlp/pull/12)

## [2.0.0] - 2015-09-23
- User ``Buffer`` values as input for encoding
- User `Buffer` values as input for encoding
[2.0.0]: https://github.com/ethereumjs/rlp/compare/1.1.2...2.0.0
## [1.1.2] - 2015-09-22
- Fix zero encoding

@@ -31,9 +62,11 @@

## [1.1.1] - 2015-09-21
- Fixes for ``bin``
- Fixes for `bin`
[1.1.1]: https://github.com/ethereumjs/rlp/compare/1.1.0...1.1.1
## [1.1.0] - 2015-09-21
- Added ``getLength()`` method
- Added hex prefix stripping (``isHexPrefix()`` / ``stripHexPrefix()``)
- Added `getLength()` method
- Added hex prefix stripping (`isHexPrefix()` / `stripHexPrefix()`)
- Code formatting clean-ups

@@ -44,2 +77,3 @@

## [1.0.1] - 2015-06-27
- Code formatting clean-ups

@@ -50,2 +84,3 @@

## [1.0.0] - 2015-06-06
- Added check for invalid 0

@@ -60,2 +95,2 @@ - Hardened rlp

- [0.0.13](https://github.com/ethereumjs/rlp/compare/0.0.12...0.0.13) - 2015-03-30
- [0.0.12](https://github.com/ethereumjs/rlp/compare/0.0.11...0.0.12) - 2014-12-26
- [0.0.12](https://github.com/ethereumjs/rlp/compare/0.0.11...0.0.12) - 2014-12-26

54

package.json
{
"name": "rlp",
"version": "2.1.0",
"version": "2.2.0",
"description": "Recursive Length Prefix Encoding Module",
"main": "index.js",
"directories": {
"test": "test"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist/**",
"bin/**"
],
"scripts": {
"coverage": "istanbul cover _mocha",
"coveralls": "npm run coverage && coveralls <coverage/lcov.info",
"lint": "standard",
"test": "istanbul test mocha -- --reporter spec",
"build": "tsc -p ./tsconfig.prod.json",
"prepublishOnly": "npm run test && npm run build",
"coverage": "nyc mocha --reporter spec --require ts-node/register test/index.ts",
"coveralls": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
"format": "prettier --list-different **/*.{ts,json,md,gql}",
"format:fix": "prettier --write **/*.{ts,json,md,gql}",
"tslint": "tslint -p ./tsconfig.json -e node_modules/**/* -e **/node_modules/**/* -e dist/**/* **/*.ts",
"tslint:fix": "tslint --fix --format stylish -p ./tsconfig.json -e node_modules/**/* -e **/node_modules/**/* -e dist/**/* **/*.ts",
"tsc": "tsc --noEmit",
"lint": "npm run format && npm run tslint && npm run tsc",
"lint:fix": "npm run format:fix && npm run tslint:fix && npm run tsc",
"unitTests": "mocha --reporter spec --require ts-node/register test/index.ts",
"test": "npm run lint && npm run unitTests",
"test:fix": "npm run lint:fix && npm run unitTests",
"webtest": "browserify test/max.js | testling -u"

@@ -29,2 +41,3 @@ },

"contributors": [
"Alex Beregszaszi <alex@rtfs.hu>",
"Holger Drewes <Holger.Drewes@gmail.com>"

@@ -40,8 +53,19 @@ ],

"devDependencies": {
"@ethereumjs/config-nyc": "^1.0.0",
"@ethereumjs/config-prettier": "^1.0.1",
"@ethereumjs/config-tsc": "^1.0.2",
"@ethereumjs/config-tslint": "^1.0.0",
"@types/bn.js": "^4.11.3",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.2",
"bn.js": "^4.11.1",
"coveralls": "^2.11.4",
"ethereumjs-testing": "git+https://github.com/ethereumjs/ethereumjs-testing.git",
"istanbul": "^0.4.2",
"mocha": "^2.3.4",
"standard": "^6.0.8"
"mocha": "4.1.0",
"nyc": "^13.1.0",
"prettier": "^1.15.2",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^3.1.6",
"typestrict": "^1.0.1"
},

@@ -63,9 +87,3 @@ "bin": {

]
},
"standard": {
"globals": [
"describe",
"it"
]
}
}

@@ -1,3 +0,3 @@

SYNOPSIS
=====
# SYNOPSIS
[![NPM Package](https://img.shields.io/npm/v/rlp.svg?style=flat-square)](https://www.npmjs.org/package/rlp)

@@ -8,30 +8,24 @@ [![Build Status](https://img.shields.io/travis/ethereumjs/rlp.svg?branch=master&style=flat-square)](https://travis-ci.org/ethereumjs/rlp)

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
[Recursive Length](https://github.com/ethereum/wiki/wiki/RLP) Prefix Encoding for node.js.
## INSTALL
[Recursive Length](https://github.com/ethereum/wiki/wiki/RLP) Prefix Encoding for node.js.
`npm install rlp`
INSTALL
======
`npm install rlp`
install with `-g` if you want to use the cli.
USAGE
=======
## USAGE
```javascript
var RLP = require('rlp');
var assert = require('assert');
var RLP = require('rlp')
var assert = require('assert')
var nestedList = [ [], [[]], [ [], [[]] ] ];
var encoded = RLP.encode(nestedList);
var decoded = RLP.decode(encoded);
assert.deepEqual(nestedList, decoded);
var nestedList = [[], [[]], [[], [[]]]]
var encoded = RLP.encode(nestedList)
var decoded = RLP.decode(encoded)
assert.deepEqual(nestedList, decoded)
```
## API
```
API
=====
`rlp.encode(plain)` - RLP encodes an `Array`, `Buffer` or `String` and returns a `Buffer`.

@@ -41,13 +35,13 @@

CLI
===
`rlp decode <hex string>`
`rlp encode <json String>`
## CLI
TESTS
=====
Test uses mocha. To run `npm test`
`rlp decode <hex string>`
`rlp encode <json String>`
CODE COVERAGE
=============
## TESTS
Test uses mocha. To run tests and linting: `npm test`. To auto fix linting problems use: `npm run test:fix`.
## CODE COVERAGE
Install dev dependencies

@@ -54,0 +48,0 @@ `npm install`

Sorry, the diff of this file is not supported yet

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