22 lines
500 B
C#
22 lines
500 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|