Exemple #1
0
        /**** Cryptography *****/

        public static string Hash(string data)
        {
            var bytes = Encoding.UTF8.GetBytes(data);

#if NETFX_CORE
            /*if (sha1 == null)
             *      sha1 = KeyDerivationAlgorithmProvider.OpenAlgorithm(KeyDerivationAlgorithmNames.Pbkdf2Sha1);*/
            throw new NotImplementedException("WinRT...");
#else
            if (sha1 == null)
            {
                sha1 = Encryptor.Current.CreateHash();
            }
            var hash = sha1.Compute20(bytes);
            return(BytesToString(hash));
#endif
        }