Skip to content

Instantly share code, notes, and snippets.

View lancearlaus's full-sized avatar

Lance Arlaus lancearlaus

View GitHub Profile
@lancearlaus
lancearlaus / merkle.groovy
Last active September 9, 2017 02:55
Demonstrate Merkle trees by "Merklizing" the words of a sentence supplied as command line arguments
#!/usr/local/bin/groovy
/*
* Demonstrate Merkle trees by "Merklizing" the words of a sentence supplied as command line arguments
* Example: merkle The dog jumped over the moon
*/
HASHPREFIXLEN = 8
static byte[] hash(List<byte[]> input) {