Re: encrypting lines from file with md5 module doesn't work?

2009-02-14 Thread Canned
Nick Craig-Wood schreef: > Canned wrote: >> I write a small script that read lines from plain text file and encrypt >> each lines using md5 module. I have a small word list that contain 2000+ >> words, 1 word/line. Using the code below, I can save the output to >>

Re: encrypting lines from file with md5 module doesn't work?

2009-02-14 Thread Canned
MRAB schreef: > Canned wrote: >> Hi, >> I need some help with my script. I hope someone can show me the right >> direction or at least explain to me what did I wrong? >> >> I write a small script that read lines from plain text file and encrypt >> each line

encrypting lines from file with md5 module doesn't work?

2009-02-14 Thread Canned
Hi, I need some help with my script. I hope someone can show me the right direction or at least explain to me what did I wrong? I write a small script that read lines from plain text file and encrypt each lines using md5 module. I have a small word list that contain 2000+ words, 1 word/line. Using

Re: translating ascii to binary

2008-09-17 Thread Canned
Steven D'Aprano schreef: > Your "ascii_to_bin" method tries to do too much in one method. You should > split the functionality into small, self-contained pieces, then combine > them. And frankly, once you got to the part where you started popping and > inserting, my brain melted. You are making

translating ascii to binary

2008-09-17 Thread Canned
Hi, I'm trying to write a class that can convert ascii to binary and vice versa. I write my class based on this function I've found on internet > def ascii_to_bin(char): > ascii = ord(char) > bin = [] > > while (ascii > 0): > if (ascii & 1) == 1: > bin.append("1") > else: > bin.append("0") > ascii