using System.Security.Cryptography;
public static void Main()
MD5 md5Hash = MD5.Create();
SHA256 sha256 = SHA256.Create();
string formattedDateTime = DateTime.UtcNow.ToString("yyyyMMddHHmmssfff");
Console.WriteLine(formattedDateTime);
byte[] urlInBytes = Encoding.UTF8.GetBytes("https://portal.nedsecure.co.za/api/merchant/configuration?mode=test");
byte[] timeStampInBytes = Encoding.UTF8.GetBytes(formattedDateTime);
byte[] hashedPasswordInBytes =
md5Hash.ComputeHash(Encoding.UTF8.GetBytes("Blue2583!"));
byte[] token = new byte[urlInBytes.Length + timeStampInBytes.Length +
hashedPasswordInBytes.Length];
Buffer.BlockCopy(urlInBytes, 0, token, 0, urlInBytes.Length);
Buffer.BlockCopy(timeStampInBytes, 0, token, urlInBytes.Length, timeStampInBytes.Length);
Buffer.BlockCopy(hashedPasswordInBytes, 0, token, urlInBytes.Length +
timeStampInBytes.Length, hashedPasswordInBytes.Length);
byte[] hashedTokenInBytes = sha256.ComputeHash(token);
string base64Token = Convert.ToBase64String(hashedTokenInBytes);
Console.WriteLine(base64Token);