📜  c# 从哈希生成 guid - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.394000             🧑  作者: Mango

代码示例1
using System.Security.Cryptography;

        private static Guid GuidFromString(string input)
        {
            using (MD5 md5 = MD5.Create())
            {
                byte[] hash = md5.ComputeHash(Encoding.Default.GetBytes(input));
                return new Guid(hash);
            }
        }