Facebook.FacebookClient.ComputeHmacSha1Hash C# (CSharp) Method

ComputeHmacSha1Hash() private static method

private static ComputeHmacSha1Hash ( byte data, byte key ) : byte[]
data byte
key byte
return byte[]
        private static byte[] ComputeHmacSha1Hash(byte[] data, byte[] key)
        {
            if (data == null)
                throw new ArgumentNullException("data");
            if (key == null)
                throw new ArgumentNullException("key");

            //https://channel9.msdn.com/Forums/TechOff/Porting-to-WinRT/4df7586e1ef5400682eda00f0143b610

            MacAlgorithmProvider macAlgorithmProvider = MacAlgorithmProvider.OpenAlgorithm("HMAC_SHA1");
            //BinaryStringEncoding encoding = BinaryStringEncoding.Utf8;

            CryptographicKey hmacKey = macAlgorithmProvider.CreateKey(key.AsBuffer());
            IBuffer signedMessage = CryptographicEngine.Sign(hmacKey, data.AsBuffer());
            //var hashedString  = CryptographicBuffer.EncodeToBase64String(signedMessage);

            return signedMessage.ToArray();
            

            ////using (var crypto = new System.Security.Cryptography.HMACSHA1(key))
            ////{
            ////    return crypto.ComputeHash(data);
            ////}
        }
    }