All pastes #147024 Raw Edit

Shin-Ra

public text v1 · immutable
#147024 ·published 2006-08-24 02:07 UTC
rendered paste body
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Security.Cryptography;
using System.Text;

public partial class _Default : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		Response.Write(StrToByteArray("Hi"));
	}

	public void HashData(HashAlgorithm hashAlg, string str)
	{
		byte[] rawBytes = ASCIIEncoding.ASCII.GetBytes(str);
		byte[] hashData = hashAlg.ComputeHash(rawBytes);
	}
	public byte[] StrToByteArray(string str)
	{
		ASCIIEncoding encoding = new ASCIIEncoding();
		SHA512 sha = new SHA512Managed();
		return encoding.GetBytes(str);
	}
}