gdritter repos drunken-bishop / 945ecc5
Added README + restricted import list Getty Ritter 8 years ago
2 changed file(s) with 25 addition(s) and 1 deletion(s). Collapse all Expand all
11 {-# LANGUAGE BinaryLiterals #-}
22
3 module Data.Digest.DrunkenBishop where
3 module Data.Digest.DrunkenBishop (drunkenBishop) where
44
55 import Data.Array
66 import Data.Bits
1 # `drunken-bishop`
2
3 ```
4 $ echo 'drunken bishop' | drunken-bishop
5 +-----------------+
6 | o.. ..o Eo|
7 | .o..o o ...o|
8 | *. . .. . |
9 | o +.. . |
10 | =S. . |
11 | +o . |
12 | . o . |
13 | o |
14 | |
15 +-----------------+
16 ```
17
18 This is a small implementation of the [Drunken Bishop algorithm](https://pthree.org/2013/05/30/openssh-keys-and-the-drunken-bishop/) for generating those random art images you see for SSH key fingerprints. It was mostly for my own edification. There's a library that exposes a function
19
20 ```{.haskell}
21 drunkenBishop :: Data.ByteString.Lazy.ByteString -> String
22 ```
23
24 which performs an MD5 hash of the input and then uses that hash to guide the Drunken Bishop algorithm. There's also an executable that reads `stdin` and formats the output image in an ASCII art frame.