From anonymous, 1 Month ago, written in Python.
This paste is a reply to Re: Untitled from anonymous
- view diff
Embed
  1. def dec(bytestr):
  2.     positions = [8, 6, 5, 4, 7, 3, 2, 1]
  3.     res = []
  4.     for c in bytestr:
  5.         outc = 0x2800
  6.         for i in range(0, 8):
  7.             if c & (1 << i):
  8.                 outc |= (1 << (positions[i]-1))
  9.         res.append(chr(outc))
  10.  
  11.     return ''.join(res)