Skip to content

Instantly share code, notes, and snippets.

View wandrson's full-sized avatar

Walter Anderson wandrson

  • Dallas, TX
View GitHub Profile
@wandrson
wandrson / analyze.py
Created March 27, 2014 18:21
Python scrupt that performs basic tests (derived from ent utility) on a binary file and also produces both a histogram of the distribution of bytes as well as a scatter plot of those byte pairs. Useful for preliminary testing of quality of entropy (random) data sources.
#! /usr/bin/python
#
# This program will take a file name from the command line and analyze its entropy, using many of the same algorithms
# as the ent program from hotbits
import sys
import struct
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
@wandrson
wandrson / RandomCardDraw.pde
Last active August 29, 2015 13:57
The following example demonstrates how to produce the numbers 1 to X in a random order, where each number only appears once, and that all numbers are produced.
// FILE: RandomCardDraw.ino
// AUTHOR: Rob Tillaart and Walter Anderson
// VERSION: 1.0.0
// PURPOSE: generate random sequence (optimized)
// DATE: April 24, 2014
// URL:
// The Entropy library provides true random numbers and can be obtained from:
// http://code.google.com/p/avr-hardware-random-number-generation/wiki/WikiAVRentropy
#include <Entropy.h>