private string GetHash(string url) { using (var md5 = MD5.Create()) { var bytes = md5.ComputeHash(Encoding.UTF8.GetBytes(url)); return(_base62Converter.ToBase62(bytes)); } }
public string GenerateId() { using (var cryptoServiceProvider = new RNGCryptoServiceProvider()) { var binary = new byte[14]; cryptoServiceProvider.GetNonZeroBytes(binary); return(_base62Converter.ToBase62(binary).Substring(0, 16)); } }