SHA384 C# with Example



SHA384 C# with Example

using System; 
using System.Security.Cryptography; 
using System.Text; 
namespace ConsoleApplication1 
{ 
 

class Program 
{ 
static void Main(string[] args) 
{ 
string source = "Hello World!"; 
using (SHA384 sha384Hash = SHA384.Create()) 
{ 
//From String to byte array 
byte[] sourceBytes = Encoding.UTF8.GetBytes(source); 
byte[] hashBytes = sha384Hash.ComputeHash(sourceBytes); 
string hash = BitConverter.ToString(hashBytes).Replace("-", String.Empty); 
Console.WriteLine("The SHA384 hash of " + source + " is: " + hash); 
} 
} 
} 
} 
Output: 
The SHA384 hash of Hello World! is: 
BFD76C0EBBD006FEE583410547C1887B0292BE76D582D96C242D2A792723E3FD6FD061F9D5CFD13B8F961358E6A 
DBA4A 

0 Comment's

Comment Form

Submit Comment