* Stephane Bortzmeyer:
On Tue, Jul 12, 2005 at 12:26:30PM +0200,
Stephane Bortzmeyer <bortzmeyer(_at_)nic(_dot_)fr> wrote
a message of 30 lines which said:
And you put the data in hexadecimal. (The attached Python script
converts it.)
Really attached, this time.
*sigh*
Corrected version is below.
#!/usr/bin/python
import sys
if len(sys.argv) != 2:
sys.stderr.write("Usage: %s phrase\n" % sys.argv[0])
sys.exit(1)
phrase = sys.argv[1]
l = len(phrase)
sys.stdout.write("\# %i " % (l + (l + 255) / 256))
while phrase <> "":
p = phrase[:255]
sys.stdout.write("%02x" % len(p))
for letter in p:
sys.stdout.write("%02x" % ord(letter))
phrase = phrase[255:]
sys.stdout.write("\n")