npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@biut-block/biutjs-rlp

v1.0.0

Published

biutjs blockchain rlp lib

Downloads

7

Readme

JavaScript Style Guide

[JavaScript Style Guide]


SECRlpEncode

This package is used for SEC blockchain rlp encoding.


new SECRlpEncode(config)

new SECRlpEncode(config) Constructs a rlp encode class.

| Param | Type | Description | | --- | --- | --- | | config | TBD | TBD, will be implemented in the future |

Example

const RLP = require('encode.js')

const rlp = new RLP()

SECRlpEncode.encode(input, buffer, offset) ⇒ Buffer

Returns input in RLP encoded format

| Param | Type | Description | | --- | --- | --- | | input | {Buffer, String, Integer, Array} | Input data for RLP encode | | buffer | {Buffer} | Input buffer which is in RLP encoded format | | offset | {Buffer} | Buffer offset position |


SECRlpEncode.decode(input, start, end) ⇒ Array

RLP decode for input data

| Param | Type | Description | | --- | --- | --- | | input | {Buffer, String, Integer, Array} | Input should be in RLP encoded structure | | start | {Integer} | "input" data array starting index | | end | {Integer} | "input" data array ending index |


SECRlpEncode.getLength(input) ⇒ Number

Returns input's length according to the first several indication bytes

| Param | Type | Description | | --- | --- | --- | | input | {Buffer, String, Integer, Array} | Input should be in RLP encoded data, or the returned length is wrong |


中文简介:

本库函数用于SEC区块链的RLP编码 RLP编码用于存储和传输数据,处理数据则用.json格式文件 json文件由RLP编码过以后,由于json文件的键值被去掉了,仅保留内容,因此剩下了大量的空间

主要的函数:

  1. RLP编码: encode(input, buffer, offset) => Buffer 输入"input"可以是{Buffer,String,Integer,Array},RLP编码仅对两种数据结构进行处理:列表及字符串 Nodejs中Array即为列表,其他类型{Buffer,String,Integer}作为字符串处理 该函数的输出结果为RLP编码后的input,类型为Buffer

  2. RLP解码:decode(input, start, end) => Array 输入"input"可以是{Buffer,String,Integer,Array},无论哪种类型,都会被先转换为Buffer类型再进行处理 作用与encode相反,将RLP格式的数据进行解码, 输出为Array类型

  3. 获取长度函数: getLength(input) => Number input为经过RLP编码后的数据 函数根据前几个字节的值获取整个input数据的长度