Skip to content

Instantly share code, notes, and snippets.

@skenderbeu

skenderbeu/getSHA1

Created Jun 29, 2018
Embed
What would you like to do?
private System.Byte[] getSHA1(Str _input)
{
System.Security.Cryptography.SHA1Managed sha1Managed;
System.Text.Encoding encoding;
System.Byte[] bytes;
str errorMessage;
try
{
sha1Managed = new System.Security.Cryptography.SHA1Managed();
encoding = System.Text.Encoding::get_Default();
bytes = sha1Managed.ComputeHash(encoding.GetBytes(_input));
}
catch
{
errorMessage = AifUtil::getClrErrorMessage();
if(errorMessage)
{
throw error (errorMessage);
}
}
return bytes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.