July: Knitting and Binary!

Knitting and Binary are actually quite similar, in knitting there are two basic stitches… knit and perl.

So this stocking celebrates the pure geekery of binary!

Side 01

Side 10

For those of you that I know would spend hours attempting to decipher what it is on this wrap around design I’ll give you the code and the means to translate.

Here’s the binary on the stocking:

01001000 01100001
01110000 01110000
01111001

00100000 01000011
01101000 01110010
01101001 01110011
01110100 01101101
01100001 01110011

00100000 01001000
01100001 01101110
01110101 01101011
01101011 01100001
01101000

00100000 01000110
01100101 01110011
01110100 01101001
01110110 01110101
01110011

In addition to using that in a binary translator online, here’s the code you can run in a terminal window to translate (courtesy of Ben):

#!/usr/bin/perl -n

while (/([01]+)/g) {
$str = $1;
if ($str =~ /^0/) {
substr($str, 0, 1, ”);
}
print chr(oct(“0b$str”));
}

END {
print $/;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s