using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Security.Cryptography;
public partial class UserDefinedFunctions
{
[Microsoft.SqlServer.Server.SqlFunction]
public static byte[] ArvutaRasi(SqlString sona) //STRINGINA ANNAB teksti sisse
{
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
byte[] data = encoding.GetBytes((string)sona); ;
byte[] result;
SHA512 shaM = new SHA512Managed(); //SHA512 või mõni muu
result = shaM.ComputeHash(data);
return result; //bitijada tagasi
}
};
Blogged with the Flock Browser