Bit Jet


In [1]:
import os, string, time
import bitjet
from IPython.display import display
from ipywidgets import IntSlider
from traitlets import link

In [2]:
bw = bitjet.BinaryView(datawidth=32)

In [3]:
bw.data = bitjet.__logo__

In [4]:
bw.blockwidth = bw.blockheight = 8

In [5]:
i = IntSlider(min=2, max=450, value=56)
link((i, "value"), (bw, "datawidth"))
display(i)
display(bw)

In [6]:
# Find the hidden logo
i.min=28
i.max=84
for ii in range(28,84):
    time.sleep(0.1)
    i.value = ii
    if ii == 56:
        time.sleep(1)

Switch between binary view and hex view


In [7]:
bw.bits_per_block = 8

Read in whole files! View in Grayscale hex!


In [8]:
bw2 = bitjet.BinaryView(datawidth=128, bits_per_block=8)
i = IntSlider(min=2, max=1024, value=bw2.datawidth)
l = link((i, "value"), (bw2, "datawidth"))

In [9]:
bw2.blockheight = bw2.blockwidth = 2
bw2.width = bw2.height = 512
bw2.data = open("/usr/bin/openssl", "rb").read(2**7)

In [10]:
display(i)
display(bw2)