/** * A bucket table implementation based on linear hashing. (https://en.wikipedia.org/wiki/Linear_hashing) * Compare to Table, it uses less storage slots but has higher chance of collision, it's a trade-off between space and time. * Compare to other implementation, linear hashing splits one bucket a time instead of doubling buckets when expanding to avoid unexpected gas cost. * BucketTable uses faster hash function SipHash instead of cryptographically secure hash functions like sha3-256 since it tolerates collisions. * * **Module ID:** `0x1::bucket_table` * * @module */ import type * as p from "@movingco/prelude"; /** Type name: `0x1::bucket_table::BucketTable` */ export interface IBucketTable<_K = unknown, _V = unknown> { buckets: { inner: { handle: p.U128; }; length: p.U64; }; num_buckets: p.U64; level: number; len: p.U64; } /** * BucketTable entry contains both the key and value. * * Type name: `0x1::bucket_table::Entry` */ export interface IEntry<_K = unknown, _V = unknown> { hash: p.U64; key: _K; value: _V; } export { idl } from "./idl.js"; /** The address of the module. */ export declare const ADDRESS: "0x1"; /** The full module name. */ export declare const FULL_NAME: "0x1::bucket_table"; /** The name of the module. */ export declare const NAME: "bucket_table"; /** Module ID information. */ export declare const id: { readonly ADDRESS: "0x1"; readonly FULL_NAME: "0x1::bucket_table"; readonly NAME: "bucket_table"; }; export * as errors from "./errors.js"; /** Module error codes. */ export declare const errorCodes: { readonly "1": { readonly name: "ENOT_FOUND"; readonly doc: "Key not found in the bucket table"; }; readonly "2": { readonly name: "EZERO_CAPACITY"; readonly doc: "Bucket table capacity must be larger than 0"; }; readonly "3": { readonly name: "ENOT_EMPTY"; readonly doc: "Cannot destroy non-empty hashmap"; }; readonly "4": { readonly name: "EALREADY_EXIST"; readonly doc: "Key already exists"; }; }; /** All module function IDLs. */ export declare const functions: {}; /** All struct types with ability `key`. */ export declare const resources: {}; /** All struct types. */ export declare const structs: { readonly BucketTable: "0x1::bucket_table::BucketTable"; readonly Entry: "0x1::bucket_table::Entry"; }; /** * A bucket table implementation based on linear hashing. (https://en.wikipedia.org/wiki/Linear_hashing) * Compare to Table, it uses less storage slots but has higher chance of collision, it's a trade-off between space and time. * Compare to other implementation, linear hashing splits one bucket a time instead of doubling buckets when expanding to avoid unexpected gas cost. * BucketTable uses faster hash function SipHash instead of cryptographically secure hash functions like sha3-256 since it tolerates collisions. */ export declare const moduleDefinition: { readonly errorCodes: { readonly "1": { readonly name: "ENOT_FOUND"; readonly doc: "Key not found in the bucket table"; }; readonly "2": { readonly name: "EZERO_CAPACITY"; readonly doc: "Bucket table capacity must be larger than 0"; }; readonly "3": { readonly name: "ENOT_EMPTY"; readonly doc: "Cannot destroy non-empty hashmap"; }; readonly "4": { readonly name: "EALREADY_EXIST"; readonly doc: "Key already exists"; }; }; readonly functions: {}; readonly resources: {}; readonly structs: { readonly BucketTable: "0x1::bucket_table::BucketTable"; readonly Entry: "0x1::bucket_table::Entry"; }; readonly ADDRESS: "0x1"; readonly FULL_NAME: "0x1::bucket_table"; readonly NAME: "bucket_table"; }; //# sourceMappingURL=index.d.ts.map