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.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

In reply to Re: how to get a 64bit random number with rand() ? by BrowserUk
in thread how to get a 64bit random number with rand() ? by iglake

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.