• henfredemars@infosec.pub
    link
    fedilink
    English
    arrow-up
    10
    ·
    1 month ago

    It’s also not sufficient to randomize a deck of cards using a 32-bit seed as was once common in software.

    Indeed, even with a 64 bit seed, it is not sufficient.

        • derekabutton@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          15 days ago

          Yeah looks like I did something wrong. Must have just been looking at the numbers raised by powers of 2. Good find! Thank you

          • CodexArcanum@lemmy.dbzer0.com
            link
            fedilink
            English
            arrow-up
            2
            ·
            15 days ago

            No problem! It only stood out to me because it’d be an amazing coincidence if 52! fit snuggly into 2^8. Being a nerd, I have many powers of 2 memorized!

            With a little playing around, it seems like 57! is the last whole number that fits (254.5 bits needed) so you could add a couple of jokers in or even use a tarot deck’s minor arcana (56 cards) and have room with a 256-bit wide BigInt, with a few bits to spare!

    • mindbleach
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      x = new Array(52).fill(0).map( (v,i,a) => i+1 )

      x.reduce( (a,b) => a + Math.log(b) ) / Math.log(2)

      227.02369816459176

      So it’d take 228 bits.