Close

Hint 2

A project log for HACKaDaY Super Conference Ticket

I don't need the ticket I bought for the Hackaday Super Conference, so someone else can have it.

jlbrian7jlbrian7 11/02/2016 at 23:420 Comments
        ...
            bin_message += '0'
        if g & 0b1 == 1:
            bin_message += '1'
        else:
            bin_message += '0'
        if b & 0b1 == 1:
            bin_message += '1'
        else:
            bin_message += '0'

import binascii

# You can use an online binary to ascii converter, or these functions.
# Such as this: http://www.rapidtables.com/convert/number/binary-to-ascii.htm
# http://stackoverflow.com/questions/7396849/convert-binary-to-ascii-and-vice-versa
def text_from_bits(bits, encoding='utf-8', errors='surrogatepass'):
    n = int(bits, 2)
    return int2bytes(n).decode(encoding, errors)


def int2bytes(integer):
    hex_string = '%x' % integer
    n = len(hex_string)
    return binascii.unhexlify(hex_string.zfill(n + (n & 1)))

message = text_from_bits(bin_message)

Discussions