mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-27 16:56:43 +03:00
Rewrite build_lfn_short_entry_name() and add _gen_numname_suffix() helper to match the gen_numname() algorithm in ff.c. This fixes: - chr(order) producing raw binary instead of ASCII digits - Collision for order >= 10 when str(order) makes the name exceed 8 chars - Hex suffix with dynamic stem shortening (matching C implementation) - CRC16-CCITT hash for seq > 5 to reduce collision probability Also fix LDIR_Name2_SIZE typo in long_filename_utils.py (should be LDIR_Name3_SIZE), which made the assertion guard too permissive. Add ShortFilenameGenerationTestCase with 9 unit tests covering single-digit, multi-digit, hash-based, and collision-free generation scenarios.