Here's one way on a 64-bit capable build, provided your prng can produce at least 8-bit rands:
sub rand64{ unpack 'Q', pack 'C8', map rand(256), 1 .. 8; }
for(1..10){
my $rand64 = rand64();
printf "%64s %16s %I64U\n",
unpack( 'b64', pack( 'Q', $rand64 ) ),
unpack( 'H16', pack( 'Q', $rand64 ) ),
$rand64;
}
1010111111000000011010001011001101101010011001011110100101011101 f5031
+6cd56a697ba 13445398104276075509
1011010011110001101111011011100010001000001100000001011101111110 2d8fb
+d1d110ce87e 9144572311028731693
1100000000001011011000101111011110001110110110001110000000101001 03d04
+6ef711b0794 10666524418609958915
1000101001111110010101010010011101000111000011010101100000110110 517ea
+ae4e2b01a6c 7789732994036170321
0010010000011010010011110001100000111110001011000100110111110011 2458f
+2187c34b2cf 14966082219304704036
1111100110000001010110000110011011011100010010001001000100101101 9f811
+a663b1289b4 13008949044961771935
1001111000111111101110010111001111010011011111001110101110101100 79fc9
+dcecb3ed735 3879638649068715129
0000010011010010001110011101111101011111001001110101001011100101 204b9
+cfbfae44aa7 12054699119224834848
1110111000010100001101010110011111010011111011000100010111100011 7728a
+ce6cb37a2c7 14385121508662716535
0011110011100110111011000101100110100100100110101101011101011000 3c673
+79a2559eb1a 1939742082549114684
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
In the absence of evidence, opinion is indistinguishable from prejudice.
Suck that fhit
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|