import type { PortalNetworkRoutingTable } from '../client'; import type { ENR, NodeId } from '@chainsafe/enr'; export declare const MEGABYTE = 1048576; /** * Shortens a Node ID to a readable length */ export declare const shortId: (nodeId: string | ENR, routingTable?: PortalNetworkRoutingTable) => string; /** * Generates a random node ID at the specified target log2 distance (i.e. generates a random node ID in a given k-bucket) * Follows this algorithm - https://github.com/ethereum/trin/pull/213 * @param nodeId id of the node to calculate distance from * @param targetDistance the target log2 distance to generate a nodeId at * @returns a random node ID at a log2 distance of `targetDistance` */ export declare const generateRandomNodeIdAtDistance: (nodeId: NodeId, targetDistance: number) => NodeId; /** * Generates the Content ID used to calculate the distance between a node ID and the content key * @param contentKey a serialized content key * @returns the hex encoded string representation of the SHA256 hash of the serialized contentKey */ export declare const serializedContentKeyToContentId: (contentKey: Uint8Array) => string; export declare const dirSize: (directory: string) => Promise; export declare function arrayByteLength(byteArray: any[]): number; //# sourceMappingURL=util.d.ts.map