UNPKG

ff1-js

Version:

FF1 (Format-Preserving Encryption) implementation in JavaScript/TypeScript

57 lines 1.44 kB
/** * Configuration object for FF1 instances */ export interface FF1Config { /** The radix (base) of the alphabet */ radix: number; /** The alphabet string */ alphabet: string; /** Minimum input length */ minLength: number; /** Maximum input length */ maxLength: number; /** Length of the encryption key in bytes */ keyLength: number; /** Length of the tweak in bytes */ tweakLength: number; } /** * Options for creating FF1 instances */ export interface FF1Options { /** Minimum input length (default: 2) */ minLength?: number; /** Maximum input length (default: 100) */ maxLength?: number; /** Custom alphabet (if not using predefined ones) */ alphabet?: string; /** Radix (base) of the alphabet */ radix?: number; } /** * Result of an FF1 operation */ export interface FF1Result { /** The input string */ input: string; /** The output string */ output: string; /** The operation performed (encrypt/decrypt) */ operation: 'encrypt' | 'decrypt'; /** The tweak used */ tweak: Buffer; /** Timestamp of the operation */ timestamp: Date; } /** * Validation error for FF1 parameters */ export interface FF1ValidationError { /** The field that failed validation */ field: string; /** The error message */ message: string; /** The invalid value */ value: any; } //# sourceMappingURL=types.d.ts.map