harperdb
Version:
HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.
17 lines (16 loc) • 855 B
TypeScript
import type { Resource } from '../Resource.ts';
export declare const nodeIds: Map<string, number>;
type AnalyticsHostnameResource = Resource & {
hostname: string;
};
export declare function getAnalyticsHostnameTable(): AnalyticsHostnameResource;
export declare function normalizeIPv6(ipv6: string): string;
/** stableNodeId takes a hostname or IP address and returns a number containing
* the 32-bit SHAKE128 hash of the hostname or IP address. The astute among you
* will now be thinking, "Why return a 32-bit hash of a 32-bit IPv4 address?"
* And the answer is that this is primarily intended for identifying cluster
* nodes, and in production those should always use hostnames for TLS security.
* So it doesn't make much sense to optimize the IPv4 use case.
*/
export declare function stableNodeId(nodeAddrOrName: string): number;
export {};