HashData() public method

public HashData ( Windows.Storage.Streams.IBuffer data ) : Windows.Storage.Streams.IBuffer
data Windows.Storage.Streams.IBuffer
return Windows.Storage.Streams.IBuffer
示例#1
0
        private byte[] GetHash(byte[] pbEntropy)
        {
            byte[] pbNewData;

#if KeePassUWP
            Wscc.HashAlgorithmProvider hashAlgo = Wscc.HashAlgorithmProvider.OpenAlgorithm(Wscc.HashAlgorithmNames.Sha512);
            pbNewData = hashAlgo.HashData(pbEntropy.AsBuffer()).ToArray();
#else
#if KeePassLibSD
            using (SHA256Managed shaNew = new SHA256Managed())
#else
            using (SHA512Managed shaNew = new SHA512Managed())
#endif
            {
                pbNewData = shaNew.ComputeHash(pbEntropy);
            }
#endif

            return(pbNewData);
        }