示例#1
0
 private void ScanPreviewBuffer()
 {
     try {
         _photoCamera.GetPreviewBufferY(_luminance.PreviewBufferY);
         var binarizer = new HybridBinarizer(_luminance);
         var binBitmap = new BinaryBitmap(binarizer);
         var result    = _reader.decode(binBitmap);
         if (result != null)
         {
             Dispatcher.BeginInvoke(() => DisplayResult(result.Text));
             var client = new WebClient();
             var sqrl   = new SqrlUrl(result.Text);
             var nonce  = SqrlUtils.CreateClientNonce();
             client.DownloadStringAsync(new Uri(sqrl.GetClientResponse(nonce)));
         }
     } catch {
     }
 }
示例#2
0
        public void CreateNonce_Length()
        {
            var timestamp = 100000;

            Assert.AreEqual(9, SqrlUtils.CreateClientNonce(timestamp).Length);
        }
示例#3
0
        public void GetClientResponse()
        {
            var url = new SqrlUrl(ValidChallengeUri);

            Assert.AreEqual("", url.GetClientResponse(SqrlUtils.CreateClientNonce()));
        }
示例#4
0
        public void CreateNonce()
        {
            var timestamp = 100000;

            Assert.AreEqual(24, SqrlUtils.CreateClientNonce(timestamp)[0]);
        }