scripts icon indicating copy to clipboard operation
scripts copied to clipboard

shorten-filenames.sh might lengthen rather than shorten path length

Open Aikhjarto opened this issue 11 years ago • 0 comments

shasum will always produce a 40 digit hash value. If a file/folder name which is shorter than 40 digits is encoded , it actually gets longer than shorter. Steps to reproduce:

mkdir -p abcdefghij/abcdefghij/abcdefghij
shorten-filenames.sh . encode 25

This results in ./abcdefghij/abcdefghij/b92ab2ae522e8b2a922b9c9b2c4fa7f677373489 which is actually longer than the original folder ./abcdefghij/abcdefghij/abcdefghij

Aikhjarto avatar May 02 '14 10:05 Aikhjarto