https://github.com/albertnieto/anu-qrng-go
A Go client for Australia National University's quantum random number generator API.
https://github.com/albertnieto/anu-qrng-go
golang qrng
Last synced: 2 months ago
JSON representation
A Go client for Australia National University's quantum random number generator API.
- Host: GitHub
- URL: https://github.com/albertnieto/anu-qrng-go
- Owner: albertnieto
- License: apache-2.0
- Created: 2025-01-29T11:13:56.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-29T18:08:11.000Z (5 months ago)
- Last Synced: 2025-02-09T05:46:59.536Z (4 months ago)
- Topics: golang, qrng
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# anu-qrng-go
A Go client for Australia National University's quantum random number generator API.
```go
package mainimport (
"fmt"
"github.com/albertnieto/anu-qrng-go"
)func main() {
client := qrng.NewClient()
// client := qrng.NewClientWithAPIKey("KEY")
// Flip 8 quantum coins
bits, _ := client.GetRandomBits(8)
fmt.Println("Quantum bits:", bits)
// e.g., [1 0 1 1 0 1 0 1]
// Generate lottery number (1-100)
num, _ := client.GetRandomNumber(1, 100)
fmt.Println("Lucky number:", num)
// e.g., 57
}
```