drewnoakes / metadata-extractor

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Apache License 2.0
2.53k stars 473 forks source link

Fix:#640 Optimized formatHex method for efficiency and memory usage #643

Open Salman-Sayyed opened 6 months ago

Salman-Sayyed commented 6 months ago

Fixes #640

Refactored the formatHex method to enhance efficiency and address potential memory issues. The improvements include the use of a StringBuilder for string construction, masking the value to fit within the specified digits, calculating leading zeros, and optimizing the hex value append operation. These changes result in more memory-efficient handling of large numbers.