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 { } }
public void CreateNonce_Length() { var timestamp = 100000; Assert.AreEqual(9, SqrlUtils.CreateClientNonce(timestamp).Length); }
public void GetClientResponse() { var url = new SqrlUrl(ValidChallengeUri); Assert.AreEqual("", url.GetClientResponse(SqrlUtils.CreateClientNonce())); }
public void CreateNonce() { var timestamp = 100000; Assert.AreEqual(24, SqrlUtils.CreateClientNonce(timestamp)[0]); }