Beispiel #1
0
        /// <summary>
        /// transform string to hashed string whith sha 256
        /// </summary>
        /// <param name="inputString"></param>
        /// <returns></returns>
        public static string Encrypt(this string inputString, EncryptionMode mode = EncryptionMode.SHA_256)
        {
            string encrypt = string.Empty;

            if (mode == EncryptionMode.SHA_256)
            {
                encrypt = Sha.GenerateSHA256String(inputString);
            }

            if (mode == EncryptionMode.SHA_512)
            {
                encrypt = Sha.GenerateSHA512String(inputString);
            }

            return(encrypt);
        }