New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@typeberry/trie

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typeberry/trie - npm Package Compare versions

Comparing version 0.0.1-aae42cd to 0.0.1-b19c732

index.js

6

package.json
{
"name": "@typeberry/trie",
"version": "0.0.1-aae42cd",
"main": "trie.js",
"version": "0.0.1-b19c732",
"main": "index.js",
"author": "Fluffy Labs",
"license": "MPL-2.0"
}
}

@@ -0,19 +1,47 @@

/**
* A variable-length blob of bytes with a concise text representation.
*
* The structure is used as convenience wrapper for [`Uint8Array`],
* especially if the data is coming from a hex-encoded string.
*/
export declare class BytesBlob {
readonly buffer: Uint8Array;
readonly length: number;
constructor(data: Uint8Array);
private constructor();
/**
* Display a hex-encoded version of this byte blob.
*/
toString(): string;
static fromBytes(v: number[]): BytesBlob;
/** Create a new [`BytesBlob`] from existing [`Uint8Array`]. */
static fromBlob(v: Uint8Array): BytesBlob;
/** Create a new [`BytesBlob`] from an array of bytes. */
static fromNumbers(v: number[]): BytesBlob;
/** Parse a hex-encoded bytes blob without `0x` prefix. */
static parseBlobNoPrefix(v: string): BytesBlob;
/** Parse a hex-encoded bytes blob with `0x` prefix. */
static parseBlob(v: string): BytesBlob;
}
/**
* A convenience wrapper for a fix-length sequence of bytes.
*/
export declare class Bytes<T extends number> {
/** Raw bytes array. */
readonly raw: Uint8Array;
/** Length of the bytes array. */
readonly length: T;
constructor(raw: Uint8Array, len: T);
private constructor();
/** Return hex encoding of the sequence. */
toString(): string;
/** Compare the sequence to another one. */
isEqualTo(other: Bytes<T>): boolean;
/** Create new [`Bytes<X>`] given a backing buffer and it's length. */
static fromBlob<X extends number>(v: Uint8Array, len: X): Bytes<X>;
/** Create an empty [`Bytes<X>`] of given length. */
static zero<X extends number>(len: X): Bytes<X>;
/** Create a [`Bytes<X>`] with all bytes filled with given input number. */
static fill<X extends number>(len: X, input: number): Bytes<X>;
/** Parse a hex-encoded fixed-length bytes without `0x` prefix. */
static parseBytesNoPrefix<X extends number>(v: string, len: X): Bytes<X>;
/** Parse a hex-encoded fixed-length bytes with `0x` prefix. */
static parseBytes<X extends number>(v: string, len: X): Bytes<X>;
}

@@ -6,2 +6,7 @@ import { Bytes, BytesBlob } from "@typeberry/bytes";

export type TruncatedStateKey = Opaque<Bytes<31>, "stateKey">;
/**
* A state commitment.
*
* https://graypaper.fluffylabs.dev/#/387103d/0cb0000cb400
*/
export type TrieHash = Opaque<Hash, "trie">;

@@ -8,0 +13,0 @@ export type ValueHash = Opaque<Hash, "trieValue">;

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