CRC32 is higher than MD5 repetition rate,
However, we can still compress the 32-bit UUID string into a shorter shaped unique identity by using CRC32 and then turning the long shaping.
1 /**2 * 3 * @Title: Getcrc32value4 * @author: Liuyx5 * @date: November 6, 2015 PM 5:26:126 * @Description: Gets the string corresponding to the repetition probability of a smaller shape7 * @paramstr Incoming string8 * @return9 */Ten Public Staticstring Getcrc32value (String str) { One ACRC32 CRC32 =NewCRC32 (); - crc32.update (Str.getbytes ()); - System.out.println (Crc32.getvalue ()); the - /*str = str.replace ("-", "" "); - str = Str.replaceall ("[A-za-z]", ""); - if (str.length () >10) { + str = str.substring (Str.length () -10); - }else if (str.length () ==0) { + //string temp = long.tostring (System.currenttimemillis ()); A str = ""; at }*/ - returnlong.tostring (Crc32.getvalue ()); -}
Encryption algorithm using (a): using CRC32 to compress 32uuid strings