MD5
- /*
- 作者:GhostBear
- * 博客地址:Http://blog.youkuaiyun.com/ghostbera
- */
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Security.Cryptography;
- namespace EncryptAndDecrypt
- {
- public class MD5
- {
- public byte[] Hash(byte[] data)
- {
- System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
- return md5.ComputeHash(data);
- }
- }
- }
SHA1
- /*
- 作者:GhostBear
- 博客地址:Http://blog.youkuaiyun.com/ghostbera
- */
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Security.Cryptography;
- namespace EncryptAndDecrypt
- {
- public class SHA1
- {
- public byte[] Hash(byte[] data)
- {
- System.Security.Cryptography.SHA1 sha1 = System.Security.Cryptography.SHA1.Create();
- return sha1.ComputeHash(data);
- }
- }
- }
SHA256
- /*
- 作者:GhostBear
- 博客地址:Http://blog.youkuaiyun.com/ghostbera
- */
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Security.Cryptography;
- namespace EncryptAndDecrypt
- {
- public class SHA256
- {
- public byte[] Hash(byte[] data)
- {
- System.Security.Cryptography.SHA256 sha256= System.Security.Cryptography.SHA256.Create();
- return sha256.ComputeHash(data);
- }
- }
- }
SHA384
- /*
- 作者:GhostBear
- 博客地址:Http://blog.youkuaiyun.com/ghostbera
- */
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Security.Cryptography;
- namespace EncryptAndDecrypt
- {
- public class SHA384
- {
- public byte[] Hash(byte[] data)
- {
- System.Security.Cryptography.SHA384 sha384 = System.Security.Cryptography.SHA384.Create();
- return sha384.ComputeHash(data);
- }
- }
- }
SHA512
- /*
- 作者:GhostBear
- 博客地址:Http://blog.youkuaiyun.com/ghostbera
- */
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Security.Cryptography;
- namespace EncryptAndDecrypt
- {
- public class SHA512
- {
- public byte[] Hash(byte[] data)
- {
- System.Security.Cryptography.SHA512 sha512 = System.Security.Cryptography.SHA512.Create();
- return sha512.ComputeHash(data);
- }
- }
- }
1176



被折叠的 条评论
为什么被折叠?



