I'm working on a cryptography project and I need to generate all hexadecimal possible numbers (length of the number= 16 bits in binary) and put them in a list in order to use them later.
Any suggestions?
Thanks in advance
(Yet) another Python one liner :
a = [hex(x) for x in xrange(0,pow(2, 16))]
EDIT : Given all the comments, we now have :
a = map(hex, xrange(pow(2,16) - 1))
-1 at the end since xrange generates up to upperlimit-1?map for completeness. a = map(hex,xrange(pow(2,16)))0 in xrange should also be superfluous (xrange should start at 0)