Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Too long :-P solution in Uncategorized category for Bit Message by veky
def checkio(data):
rpart=lambda lst,n: [("_"+lst)[i+n:i:-1] for i in range(0,len(lst),n)]
tp,year,month,day,hour,minute,second,tz,length,*text=rpart(data,2)
if abs(int(length[::-1],16)-len(text)/[7,8,16][int(tp[0])//2]*8)>2:
text=[length]+text # some tests don't have length field :-(
decoded="".join(chr(int(x[8:]+x[:8],2)) for x in rpart("".join(
bin(int(y[::-1],16))[2:].zfill(8)[::-1] for y in text),
[7,8,16][int(tp[0])//2])).rstrip('\0')
return ["{} {} {} {}:{}:{} GMT {:+}".format(day,
rpart("naJbeFraMrpAyaMnuJluJguApeStcOvoNceD",3)[int(month)-1],
1980+(int(year)-80)%100,hour,minute,second,(80-10*int(tz[0],16)
-int(tz[1]) if tz>"80" else int(tz))//4),len(decoded),decoded]
July 12, 2013
Comments: