With these it helps Using md5 and chopping off most of it is not a good idea, because there is no guarantee that you would get a unique cache. Besides, you have much easier alternatives available to you, because you have a lot more bits than you need. Values in the range [0..232] need 32 bit (duh!). You have 12 printable characters, which give you 72 bits if you stay within Base-64 encoding range of characters. You don't even need that many characters - you can use three bits per character for the initial eight characters, and two bits per character for the last four digits. This way your 12 characters would stay in the range ['0'..'7'], and the last four would be in the range ['0'..'3']. Of course you are not bound to numeric digits - you could use letters for some groups of digits, to give it a more "randomized" appearance.
I hope this helps you . I have a hash, say "Identifier" with keys such as FACD,BDCD,DDSE,CDSD. I would like to search if the key "FXXD" is present in the hash "Identifier" by considering X to match any alphanumeric. In this scenario, it should come back with found as "FXXD" matches "FACD" considering X can be anything. , To select keys that satisfy a pattern