c# 字符串生成唯一长整型

long toVid(string str)
        {
            str = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");
            System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            byte[] res = md5.ComputeHash(Encoding.UTF8.GetBytes(str), 0, str.Length);
            return Math.Abs(BitConverter.ToInt64(res, 0));
        }


©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页