Skip to content

Instantly share code, notes, and snippets.

@skenderbeu
Created June 29, 2018 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skenderbeu/a8136acfa0a806021506ff6f38dfd018 to your computer and use it in GitHub Desktop.
Save skenderbeu/a8136acfa0a806021506ff6f38dfd018 to your computer and use it in GitHub Desktop.
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