31 lines
2.3 KiB
Markdown
31 lines
2.3 KiB
Markdown
[](https://polkadot.js.org)
|
|

|
|
[](https://github.com/Flet/semistandard)
|
|
[](https://www.npmjs.com/package/@polkadot/trie-db)
|
|
[](https://travis-ci.org/polkadot-js/trie)
|
|
[](https://codeclimate.com/github/polkadot-js/trie/maintainability)
|
|
[](https://coveralls.io/github/polkadot-js/trie?branch=master)
|
|
[](https://david-dm.org/polkadot-js/trie?path=packages/trie-db)
|
|
[](https://david-dm.org/polkadot-js/trie?path=packages/trie-db#info=devDependencies)
|
|
|
|
# @polkadot/trie-db
|
|
|
|
An Implementation of the [Ethereum Merkle Patricia Tree](https://github.com/ethereum/wiki/wiki/Patricia-Tree) that uses Blake2 for hashing.
|
|
|
|
# Adapted from Ethereum
|
|
|
|
The has been adapted from the [original EthereumJs implementation](https://github.com/ethereumjs/merkle-patricia-tree) with the following changes -
|
|
|
|
- Introduce [TypeScript](https://www.typescriptlang.org/) into the mix
|
|
- ES6-ify as applicable (Classes, `self` -> `this`, `function() {}` -> `() => {}`)
|
|
- Moves to a Promise-based interface (as applicable)
|
|
- Support only Uint8Array key/values (Buffer/String in the original)
|
|
- Use utilities from [@polkadot/util](https://github.com/polkadot-js/common)
|
|
- Supports blake2 hashing (sha3 in the original), aligning with the Polkadot tech stack)
|
|
- Updated the build steps with sources moved to [src/](src/)
|
|
- Tests updated to use [Jest](https://facebook.github.io/jest/)
|
|
- Upgrade interfaces to latest [levelup](https://github.com/Level/levelup)
|
|
- Removed the secure interface (not applicable for Substrate chains)
|
|
|
|
... well at least the above is the _idea_ behind the fork ...
|