All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
- Optimized string operations for 2-3x performance improvement on large strings
- Smart algorithm selection based on string size (< 100 chars vs > 100 chars)
- Reduced memory allocations and improved concatenation efficiency
- Batch processing optimized for handling thousands of strings efficiently
- DoS Protection: Added
maxLengthoption (default: 1,000,000 chars) to prevent memory exhaustion - Input Validation: Comprehensive validation for all parameters with type checking
- Safe Error Handling: Errors never expose sensitive information
- Injection-Safe: Safely handles XSS, SQL injection, path traversal, and other malicious patterns
- Unicode-Safe: Proper handling of emojis, multi-byte characters, and special characters
fullMask: Option to mask entire stringreverseMask: Show middle, hide edges (useful for token prefixes)percentage: Mask a specific percentage of the string (0-100)minMaskLength: Require minimum masked characters- Smart Presets: Built-in patterns for
email,creditCard, andphone obscureStringBatch(): Efficiently mask multiple strings at oncegetMaskInfo(): Preview masking without actually applying it
- Added 100+ comprehensive test cases
- Performance benchmarks for different string sizes
- Security edge case testing (XSS, injection, DoS)
- Unicode and special character handling tests
- Stress tests with very large strings
- Complete API reference with examples
- Performance characteristics and benchmarks
- Security guarantees and best practices
- Comparison with alternatives
- Migration guide for v1.x users
- Numbers and booleans are now coerced to strings (v1.x returned empty string)
- Added validation that throws errors for invalid options (v1.x silently failed)
- Export now includes
obscureStringBatchandgetMaskInfofunctions
- Fixed handling of empty strings
- Improved edge case handling for very short strings
- Fixed unicode character handling in masks