Creating an error number from stack trace
===

I'm coding in Java, on Android platform, but this isn't really a question for a specific programming language.

So ... If an error occurs in my program, i catch it within a try-catch statement and i would like to create an error number which I'll display to the user, giving him the opportunity to send me this error number.

The catch is that i would like to code the error in such a way that i get a small number (let's say a maximum of 5 digits) which i later on can decode and can find out exactly in which class, in which method and at which line number the error occured.

I'm guessing this is more of a cryptography issue, so has anyone got any ideas on how i should  go about doing this?

**EDIT**

I was thinking of giving a number to each file, each method and somehow use these values to create the error number, but i'm not sure how to calculate the actual error number so that it will work the other way around (decode it correctly).