SHOULD Python supplant Java?

Bo M. Maryniuck b.maryniuk at forbis.lt
Fri Aug 23 13:22:12 CEST 2002


On Friday 23 August 2002 13:00, d2002xx wrote:
> Nooo! no perl, never! Its code looks ugly...
Sorry for non-wrapped lines. Python-oneline :) Try:
echo 'This is a test.' | rsa.py 10001 1967cb529 #!/usr/local/bin/python -- -export-a-crypto-system-sig -RSA-in-4-lines-Python from sys import*;from string import*;a=argv;[s,p,q]=filter(lambda x:x[:1]!= '-',a);d='-d'in a;e,n=atol(p,16),atol(q,16);l=(len(q)+1)/2;o,inb=l-d,l-1+d while s:s=stdin.read(inb);s and map(stdout.write,map(lambda i,b=pow(reduce( lambda x,y:(x<<8L)+y,map(ord,s)),e,n):chr(b>>8*i&255),range(o-1,-1,-1))) 

...or...

f=lambda
x=['31312405171810171211313126112','7189749374747628707','9626701','88738091
95908988937382747529513','807979748182306979652922711','25141421122626106','
hi there!'],z=globals(),y=lambda x: reduce(lambda x,y:x+y,map(lambda
x,y=x,z=lambda
x:int(x[:2]):chr((z(y[x*int(y[-5]):])^z(y[-4:]))+z(y[-4:])),range(int(x[-2:]
)))):map(lambda
z,x=y,y=x,w=z:z(z(w[x(y[2])],x(y[3]))[0],x(y[5]))(x(y[4])),[vars(z[y(x[0])])
[y(x[1])]]) and x[-1];print f()


-- 
Regards, Bogdan

Bumper sticker: Alcohol and calculus don't mix.  Never drink and derive.





More information about the Python-list mailing list