Generate SHA 1 encrypt in Ax 2012

Ax telah menyediakan enkripsi yang bisa digunakan salah satu diantaranya SHA1. Script ini bisa dimodifikasi menggunaan encode yang diinginkan
Berikut salah satu penggunaannya :

static void SHA1()
{
System.Security.Cryptography.SHA1CryptoServiceProvider hash;
System.Text.ASCIIEncoding encoder;
System.Byte[] combined;
System.Byte byte;
str Sha1, input;
int i, arrayLength;
container cont;
;

new InteropPermission(InteropKind::ClrInterop).assert();
input = “1234567890”;
hash = new System.Security.Cryptography.SHA1CryptoServiceProvider();
encoder = new System.Text.ASCIIEncoding();
combined = encoder.GetBytes(input);
hash.ComputeHash(combined);
sha1 = System.BitConverter::ToString(hash.get_Hash());
info(stralpha(sha1));
}

Semoga membantu 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: