示例#1
0
        public bool prop_Nonce_IsHexEncoded(NonceLength nonceLength)
        {
            string nonce = Crypto.GenerateNonce(nonceLength.Get);

            return(Regex.IsMatch(nonce, @"\A\b[0-9a-fA-F]+\b\Z"));
        }
示例#2
0
        public bool prop_NonceLength_Correct(NonceLength nonceLength)
        {
            int hexEncodedNonceLength = nonceLength.Get * 2;  // 2 hex chars == 1 byte

            return(Crypto.GenerateNonce(nonceLength.Get).Length == hexEncodedNonceLength);
        }