Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Thanks to the guest who posted this - but we can do without the swearing ( )o( )...
- private static Random rnd = new Random();
- private static string Shorten(string input)
- {
- char[] arr = "ABCDEFGHIJKLMNOPQRSTUVWXQY123456789!@#$%^&*()".ToCharArray();
- for (int i = 0; i < 5; i++)
- input += arr[rnd.Next(0, arr.Length)];
- MD5CryptoServiceProvider x = new MD5CryptoServiceProvider();
- byte[] bs = System.Text.Encoding.UTF8.GetBytes(input);
- bs = x.ComputeHash(bs);
- System.Text.StringBuilder s = new System.Text.StringBuilder();
- foreach (byte b in bs)
- s.Append(b.ToString("x2").ToLower());
- return s.ToString().Remove(s.Length / + 5);
- }
Advertisement
Add Comment
Please, Sign In to add comment