Maybe there is confusion about how you really want to go about this because the spec as given is ludicrous. You have four digits to work with which means 10,000 numbers available. Assuming only lowercase letters for example (like abc.html)–
perl -le 'print 24**3'
You're already out of room with this most trivial example. Any real file names/paths will certainly not be able to fit in any translation scheme. The information must be *somewhere*. Your quest to save space by disappearing it seems magical. Pretty much everyone here is telling it to you straight.
If there is still a misunderstanding, perhaps you could give a concrete example of input (and its range) and output you expect. If what you want is possible someone will help you.