Sarah-C / Chrome_TrueRNG

Using TrueRNG in Chrome using Web Serial API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chrome: TrueRNG via Web Serial API.

Using TrueRNG in Chrome using Web Serial API.

This little webpage (linked at the bottom of this readme) has a "Connect" button to select the TrueRNG device. Once selected the page connects to it, and starts reading the random numbers produced as an array of unsigned 8 bit values every few milliseconds asynchronously.

These are written to the "Pixel display box" back-buffer. Once the back buffer is filled, it cycles around again so you can see the steady in-flow of random data being read in.

Meanwhile an animation loop running at 60 FPS takes the "Pixel display box" backbuffer and draws it to the display canvas.

All from the comfort of your browser via plain JavaScript!
https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API
image

image

There's a couple of things needed to get it working:
Use Zadig to solve the "Access is denied" error on Windows. You need to replace the existing driver with the USB Serial (CDC) driver in Zadig. Click "Options" and show all the devices.
ENSURE you have the TrueRNG selected, as you can accidently remove the drivers for your mouse and keyboard if you're not careful!
image

Also you can only run the code from HTTPS and after you've swapped the drivers, so it's not very "Plug and play" for any user out there from their desktop.

Online Example:
https://untamed.zone/TrueRNG/index.htm

About

Using TrueRNG in Chrome using Web Serial API.

License:MIT License


Languages

Language:HTML 100.0%