Generate short file & folder names for an ISO file

Dear all,

I’m trying to program an application that could generate ISO files (to be able to simulate multisession on DVD+RW and BluRay)

Unfortunaltely, I have to generate short file names (and short directory names too) from long ones that I get from Windows.
Each directory in the ISO file shall have a different name from the others. Same thing for the files.

I would just know if someone has done this before… if there is a common method and if there are some sample codes…