init project
This commit is contained in:
21
QRCodeService/Extensions/StringExtension.cs
Normal file
21
QRCodeService/Extensions/StringExtension.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace QRCodeService.Extensions
|
||||
{
|
||||
public static class StringExtension
|
||||
{
|
||||
public static byte[] ToMD5(this string value)
|
||||
{
|
||||
using (var md5 = MD5.Create())
|
||||
{
|
||||
var result = md5.ComputeHash(Encoding.UTF8.GetBytes(value));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user