Imports System
Imports System.Security.Cryptography
Imports System.Text
Imports System.Web.UI

Namespace ASP.App_Code.Data
	Public Class Hash
		Public Shared Function SHA1(ByVal src As String) As String
			Dim bytes() As Byte = Encoding.ASCII.GetBytes(src)
			Return Convert.ToBase64String((New SHA1CryptoServiceProvider()).ComputeHash(bytes)).Replace("+", "-").Replace("/", "-").Replace("=", ".")
		End Function

		Public Shared Function ForPage(ByVal page As Page) As String
			Return SHA1(page.Request.PhysicalPath)
		End Function
	End Class
End Namespace