生成16位不重复编码
/// <summary> /// 生成16位不重复编码 /// </summary> /// <returns>string</returns> public static string BuilderGuidTo16() { long i = 1; char[] az = "GFDSAHJKLMTREWQYUIOPNBVCXZ".ToCharArray(); foreach (byte byt in Guid.NewGuid().ToByteArray()) { i *= ((int)byt + 1); } string result = string.Format("{0:x}", i - DateTime.Now.Ticks); while (result.Length < 16) { result += az[new Random().Next(0, 25)]; } return result; }
Mr.Tom@live.cn