/** * Quickly converts any plain object, string, number, and more to a 32bit hash number or string * * @param obj * The object to hash * * @param asString * If true, the hash will be converted to base-36 and stringified * * @example * ```typescript * hash32('hello world') // 1047750623 * hash32('hello world', true) // 'hbsxjz' * hash32({ hello: 'world' }) // 141133545 * ``` * * Collisions are possible and likelyhood increases with the number of hashes. * * Collision odds: * - 100 32bit hashes = 1/1,000,000 * - 927 32bit hashes = 1/10,000 * - 1921 64bit hashes = 1/10,000,000,000,000 = 1/10 trillion = ~odds of a meteor hitting your house * * @ref * - https://stackoverflow.com/a/34842797 * - https://stackoverflow.com/a/22429679 * - https://preshing.com/20110504/hash-collision-probabilities/ * - https://www.ilikebigbits.com/2018_10_20_estimating_hash_collisions.html */ export declare function hash32(obj: any, asString?: false, seed?: number): number; export declare function hash32(obj: any, asString: true, seed?: number): string; /** * Quickly converts any plain object, string, number, and more to a 64bit hash number or string * * @param obj * The object to hash * * @param asString * If true, the hash will be converted to base-36 and stringified * * @example * ```typescript * hash64('hello world') // 927946135 * hash64('hello world', true) // 'fch3tj' * hash64({ hello: 'world' }) // 1139059049 * ``` * * _NOTE_ hash64 is not a true 64 bit hash and has higher collision odds than a true 64 bit hash. * * Collisions are possible and likelyhood increases with the number of hashes. * * Collision odds: * - 100 32bit hashes = 1/1,000,000 * - 927 32bit hashes = 1/10,000 * - 1921 64bit hashes = 1/10,000,000,000,000 = 1/10 trillion = ~odds of a meteor hitting your house * * @ref * - https://stackoverflow.com/a/34842797 * - https://stackoverflow.com/a/22429679 * - https://preshing.com/20110504/hash-collision-probabilities/ * - https://www.ilikebigbits.com/2018_10_20_estimating_hash_collisions.html */ export declare function hash64(obj: any, asString?: false, seed?: number): number; export declare function hash64(obj: any, asString: true, seed?: number): string;