Skip to content

bartick/rlp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Recursive Length Prefix (RLP) encoding

This is a simple implementation of the RLP encoding in Rust. I am writing this to understand the basics of rlp encoding and decoding. This is not a full implementation of the Ethereum RLP encoding.

Usage

use rlp::{encode, decode, types::RLPItem};

fn main() {
    let data: RLPItem = vec![
        "hello".into(), 
        "world".into()
    ].into();
    let encoded = encode(&data);
    let decoded = decode(&encoded);
    assert_eq!(data, decoded);
}

I have taken the inspiration from: https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/

About

Recursive-length prefix (RLP)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages