Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tinnedtuna on github.
  • I am tinnedtuna (https://keybase.io/tinnedtuna) on keybase.
  • I have a public key whose fingerprint is A45B 9785 BA62 D5EF FAB3 6D42 A079 F9D8 C704 A629

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am TinnedTuna on github.
  • I am tinnedtuna (https://keybase.io/tinnedtuna) on keybase.
  • I have a public key whose fingerprint is 06C2 F1A8 A7FA EFA8 D8F6 592D D32F 60CD 8C41 A74F

To claim this, I am signing this object:

@TinnedTuna
TinnedTuna / HeysPRNG.hs
Created September 14, 2013 21:38
A basic PRNG based on the Heys' cipher
import HeysCipher
import Data.ByteString as B
import Data.Bits
import Data.Word
import System.Environment
main = do
[arg, filename] <- getArgs
let bytes = read arg :: Integer
let randomBytes = (B.pack . genBytes . read) arg
@TinnedTuna
TinnedTuna / HeysCipher.hs
Created September 14, 2013 21:17
An implementation of Heys' Cipher.
module HeysCipher ( crypt, decrypt, Key ) where
import Data.Word
import Data.Bits
import Test.QuickCheck hiding ( (.&.) )
import Prelude hiding (round)
-- | Represents the key for a cipher, 80-bits.
type Key = (Word16, Word32, Word32)
@TinnedTuna
TinnedTuna / gist:1264112
Created October 5, 2011 10:20
Compositional Style in Python
def compose(f, g):
return lambda(x):f(g(x))
def composecurry(f):
return lambda(x) : compose(f,x)
def composevar(*fns):
acc = (lambda (x) : x)
for f in fns: