Can I create a fixed length output from a fixed length input?
See “format-preserving encryption” at WikiPedia.

Depending on the size of the message space, one can get such a scheme by:


sorting pseudorandom values, see section 4.1 of “Format preserving encryption”,
or
using this arbitrary-size scheme described in “Perfect Block Ciphers With Small Blocks”,
or
using swap-or-not as described in “An Enciphering Scheme Based on a Card Shuffle”.


Nota bene: we also have a format-preserving tag that points to related questions and answers.