UNPKG

@bonginkan/maria

Version:

MARIA OS v5.9.5 – Self-Evolving Organizational Intelligence OS | Speed Improvement Phase 3: LLM Optimization + Command Refactoring | Performance Measurement + Run Evidence System | Zero ESLint/TypeScript Errors | 人とAIが役割を持ち、学び、進化し続けるための仕事のOS | GraphRAG ×

118 lines (117 loc) 3.04 kB
/** * IEEE 802.3 CRC32 Implementation * * Provides standard CRC32 checksum calculation for data integrity * verification according to IEEE 802.3 standard */ export declare class CRC32 { private static readonly IEEE_POLYNOMIAL; private static readonly INITIAL_VALUE; private static readonly FINAL_XOR; private static lookupTable; /** * Initialize the CRC32 lookup table */ private static initializeLookupTable; /** * Calculate CRC32 checksum for string input */ static checksum(input: string): string; /** * Calculate CRC32 checksum for buffer input */ static checksumBuffer(buffer: Buffer): string; /** * Calculate CRC32 checksum for Uint8Array input */ static checksumUint8Array(array: Uint8Array): string; /** * Verify data integrity using CRC32 */ static verify(data: string | Buffer | Uint8Array, expectedChecksum: string): boolean; /** * Calculate streaming CRC32 for large data */ static createStreamingCalculator(): StreamingCRC32Calculator; /** * Get the lookup table (for testing purposes) */ static getLookupTable(): Uint32Array; /** * Test against known vectors */ static runTestVectors(): { passed: number; total: number; details: Array<{ input: string | Buffer; expected: string; actual: string; passed: boolean; }>; }; } /** * Streaming CRC32 calculator for large data processing */ export declare class StreamingCRC32Calculator { private crc; private readonly lookupTable; constructor(); /** * Update CRC with new data chunk */ update(data: string | Buffer | Uint8Array): this; /** * Get the final CRC32 checksum */ digest(): string; /** * Reset the calculator for reuse */ reset(): this; /** * Clone the current state */ clone(): StreamingCRC32Calculator; } /** * Utility functions for CRC32 operations */ export declare const CRC32Utils: { /** * Calculate CRC32 for a file (Node.js only) */ checksumFile(filePath: string): Promise<string>; /** * Compare two CRC32 checksums safely */ compareChecksums(crc1: string, crc2: string): boolean; /** * Validate CRC32 format */ isValidCRC32(checksum: string): boolean; /** * Generate checksum with metadata */ checksumWithMetadata(data: string | Buffer | Uint8Array, metadata?: { timestamp?: number; version?: string; algorithm?: string; }): { checksum: string; metadata: Record<string, unknown>; }; /** * Batch checksum calculation */ batchChecksum(items: Array<{ id: string; data: string | Buffer | Uint8Array; }>): Array<{ id: string; checksum: string; error?: string; }>; }; export declare function crc32(input: string | Buffer | Uint8Array): string;