    using System;
    using System.Security.Cryptography;
    using System.Text;
    
namespace Hydra.Framework.Cryptography
{
    /// <summary>
    /// SHA512 Hashing Service Implementation
    /// </summary>
    public class SHA512HashingService 
        : IHashingService
    {
        #region Public Methods
        /// <summary>
        /// Hashes the specified clear text.
        /// </summary>
        /// <param name="clearText">The clear text.</param>
        /// <returns></returns>
        public string Hash(string clearText)
        {
            using (var s = new SHA512Managed())
            {
                var clearBytes = Encoding.UTF8.GetBytes(clearText);
                var cipherBytes = s.ComputeHash(clearBytes);

                return Convert.ToBase64String(cipherBytes);
            }
        }
        #endregion
    }
}