@elhamdev/tracejs
Version:
A modern, privacy-conscious alternative to browser fingerprinting for unique user identification.
19 lines (18 loc) • 714 B
TypeScript
/**
* Utilities for caching fingerprint data to maintain consistency
*/
/**
* Save data to localStorage with the given key and expiration
* Note: validityPeriod parameter isn't needed here since it's only used when retrieving
*/
export declare function saveToCache<T>(key: string, data: T): void;
/**
* Retrieve data from localStorage if it exists and is still valid
* @returns The cached data if valid, null otherwise
*/
export declare function getFromCache<T>(key: string, validityPeriod?: number): T | null;
/**
* Generate a consistent key for storing fingerprint data
* This ensures fingerprints for the same origin remain stable
*/
export declare function generateCacheKey(prefix: string): string;