Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Very Large Hex Combinations

by Zaxo (Archbishop)
on Aug 04, 2005 at 14:22 UTC ( #480841=note: print w/ replies, xml ) Need Help??


in reply to Very Large Hex Combinations

To get all those from 0x00000000 to 0xFFFFFFFF, all you need to do is count - for a long time. Assuming 32-bit integers,

my $val = 0|0; do { printf "%08X\n", $val++ } while $val;

For longer strings, use Math::BigInt;.

After Compline,
Zaxo


Comment on Re: Very Large Hex Combinations
Select or Download Code
Replies are listed 'Best First'.
Re^2: Very Large Hex Combinations
by diotalevi (Canon) on Aug 04, 2005 at 16:28 UTC

    Why so complicated? A simple foreach iterator loop will suffice. Its also the cheapest in runtime.

    printf "%08x\n", $_ for 0 .. ~0;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://480841]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2015-07-08 08:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (98 votes), past polls