This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Logger | |
LEVELS = [:debug, :info, :warn, :error, :fatal] | |
attr_accessor :level | |
def initialize(name) | |
@name = name | |
@level = :info | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: example | |
example: example.c | |
gcc example.c -lotr -o example | |
.PHONY: clean | |
clean: | |
rm -f example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Blind liability proof based on bitcoin merkle trees | |
module BLProof | |
def self.sha256 data | |
Digest::SHA256.base64digest(data) | |
end | |
def self.hash_nodes a, b | |
value = a[:value] + b[:value] | |
hash = sha256( value.to_s + a[:hash] + b[:hash] ) |