Barcodes are (typically) wide in order to relieve the reader of the need for precise alignment with the printed code. The track under the read head is probably a good bit narrower (no pun intended) than 1 mm.
0-5000 requires 13 binary bits to encode. It is a fact of life (and also physics) that there will always be issues with bit cell to bit cell distortion so you will need SOME type of redundancy built into your code to permit reliable readback. Lets guess at full 100% reduncancy and you get up to 26 bits of information to encode into your stamp.
Now it also sounds like to me that the selection of 0 to 5000 as a range is tied to some present tense application need. I would include more bits for further expansion or flexibilty. Why not pick another batch of bits and move up to 64 bits total.
I think you would be better off looking at a small square type bar code like a Datamatrix code. See this link for a quick description of such codes:
formatting link
or
formatting link
It is possible to make small bar code readers which can image a Datamatrix bar code. For example check out this link:
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.