All Projects → web3p → rlp

web3p / rlp

Licence: MIT license
Recursive Length Prefix Encoding in PHP.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to rlp

minter-go-sdk
Minter Blockchain Golang SDK, 💳 wallet, 🧾 transactions, gRPC and HTTP clients 🌐 https://t.me/MinterGoSDK
Stars: ✭ 12 (-52%)
Mutual labels:  transaction, rlp
eth.rb
a straightforward library to build, sign, and broadcast ethereum transactions anywhere you can run ruby.
Stars: ✭ 111 (+344%)
Mutual labels:  transaction, rlp
mxfactorial
a payment application intended for deployment by the united states treasury
Stars: ✭ 36 (+44%)
Mutual labels:  transaction
node-pg-large-object
Large object support for PostgreSQL clients using the node-postgres library.
Stars: ✭ 31 (+24%)
Mutual labels:  transaction
saga-pattern-nodejs-aws
An implementation of Saga pattern for distributed transactions with NodeJS and AWS
Stars: ✭ 34 (+36%)
Mutual labels:  transaction
orchestrate-node
This Orchestrate library provides convenient access to the Orchestrate API from applications written in server-side NodeJS
Stars: ✭ 19 (-24%)
Mutual labels:  transaction
arweave-python-client
This client allows you to integrate your python apps with the Arweave network allowing you to perform wallet operations and transactions
Stars: ✭ 87 (+248%)
Mutual labels:  transaction
Transactional-NTFS-TxF-.NET
Transactional NTFS (TxF) Library .NET is a small library .Net (C#) allows to use transactions on NTFS FileSystem (Transactional NTFS (TxF))
Stars: ✭ 20 (-20%)
Mutual labels:  transaction
blockchain-pen
BlockchainPen - a web app for writing immutable messages to the blockchain.
Stars: ✭ 14 (-44%)
Mutual labels:  transaction
ddal
DDAL(Distributed Data Access Layer) is a simple solution to access database shard.
Stars: ✭ 33 (+32%)
Mutual labels:  transaction
web trader
📊 Python Flask game that consolidates data from Nasdaq, allowing the user to practice buying and selling stocks.
Stars: ✭ 21 (-16%)
Mutual labels:  transaction
LocalTransactionTableTest
利用rabbitmq做消息队列,通过本地消息事务表序列化消息,通过定时轮训保证消息强行落地,最终达到数据最终一致性
Stars: ✭ 19 (-24%)
Mutual labels:  transaction
KuiBaDB
Another OLAP database
Stars: ✭ 297 (+1088%)
Mutual labels:  transaction
laravel-reset-transaction
distributed transaction for call remote api service
Stars: ✭ 40 (+60%)
Mutual labels:  transaction
SimpleCoin
A simple cryptocurrency application for educational purposes only.
Stars: ✭ 13 (-48%)
Mutual labels:  transaction
trakeva
Transactions, Keys, and Values
Stars: ✭ 24 (-4%)
Mutual labels:  transaction
OGMNeo
[No Maintenance] Neo4j nodeJS OGM(object-graph mapping) abstraction layer
Stars: ✭ 54 (+116%)
Mutual labels:  transaction
indexeddb-orm
Indexed DB ORM
Stars: ✭ 53 (+112%)
Mutual labels:  transaction
DYFStoreKit
([Swift] https://github.com/chenxing640/DYFStore) A lightweight and easy-to-use iOS library for In-App Purchases (Objective-C). DYFStoreKit uses blocks and notifications to wrap StoreKit, provides receipt verification and transaction persistence and doesn't require any external dependencies.
Stars: ✭ 52 (+108%)
Mutual labels:  transaction
trans-dsl
a transaction model framework, seems simple but powerful
Stars: ✭ 64 (+156%)
Mutual labels:  transaction

rlp

PHP codecov Licensed under the MIT License

Recursive Length Prefix Encoding in PHP.

Install

Set minimum stability to dev

composer require web3p/rlp

Usage

RLP encode:

use Web3p\RLP\RLP;

$rlp = new RLP;
// c483646f67
$encoded = $rlp->encode(['dog']);

// 83646f67
$encoded = $rlp->encode('dog');

RLP decode:

use Web3p\RLP\RLP;
use Web3p\RLP\Types\Str;

$rlp = new RLP;
$encoded = $rlp->encode(['dog']);

// only accept 0x prefixed hex string
$decoded = $rlp->decode('0x' . $encoded);

// show 646f67
echo $decoded[0];

// show dog
echo hex2bin($decoded[0]);

// or you can
echo Str::decodeHex($decoded[0]);

API

Web3p\RLP\RLP

encode

Returns recursive length prefix encoding of given inputs.

encode(mixed $inputs)

Mixed inputs - array of string, integer or numeric string.

Note: output is not zero prefixed.

Example
  • Encode array of string.
use Web3p\RLP\RLP;

$rlp = new RLP;
$encoded = $rlp->encode(['web3p', 'ethereum', 'solidity']);

decode

Returns array recursive length prefix decoding of given data.

decode(string $input)

String input - recursive length prefix encoded string.

Note: output is not zero prefixed.

Example
  • Decode recursive length prefix encoded string.
use Web3p\RLP\RLP;
use Web3p\RLP\Types\Str;

$rlp = new RLP;
$encoded = $rlp->encode(['web3p', 'ethereum', 'solidity']);
$decoded = $rlp->decode('0x' . $encoded);

// echo web3p
echo hex2bin($decoded[0]);

// echo ethereum
echo hex2bin($decoded[1]);

// echo solidity
echo hex2bin($decoded[2]);

// or you can
echo Str::decodeHex($decoded[0]);
echo Str::decodeHex($decoded[1]);
echo Str::decodeHex($decoded[2]);

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].