Skip to content
  • Hjem
  • Seneste
  • Etiketter
  • Populære
  • Verden
  • Bruger
  • Grupper
Temaer
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Kollaps
FARVEL BIG TECH
  1. Forside
  2. Ikke-kategoriseret
  3. For my birthday, my brother-in-law gave me a 4992-digit hex number that, when used as a seed for Python’s random number generator, makes it so that printing a sequence of “random” ASCII characters actually prints a birthday greeting.

For my birthday, my brother-in-law gave me a 4992-digit hex number that, when used as a seed for Python’s random number generator, makes it so that printing a sequence of “random” ASCII characters actually prints a birthday greeting.

Planlagt Fastgjort Låst Flyttet Ikke-kategoriseret
25 Indlæg 21 Posters 0 Visninger
  • Ældste til nyeste
  • Nyeste til ældste
  • Most Votes
Svar
  • Svar som emne
Login for at svare
Denne tråd er blevet slettet. Kun brugere med emne behandlings privilegier kan se den.
  • robinhouston@mathstodon.xyzR robinhouston@mathstodon.xyz

    For my birthday, my brother-in-law gave me a 4992-digit hex number that, when used as a seed for Python’s random number generator, makes it so that printing a sequence of “random” ASCII characters actually prints a birthday greeting.

    I find it rather amazing that this is possible!

    This is the program he sent with the seed:

    with open("seed.txt", encoding="ascii") as handle:
    seed = int(handle.read().strip(), 0)
    r = random.Random(seed)
    pending = ""
    while True:
    character = chr(r.randrange(128))
    if pending + character == "\x1e\x1f":
    break
    print(pending, end="")
    pending = character
    print()

    realcainmosni@mastodon.me.ukR This user is from outside of this forum
    realcainmosni@mastodon.me.ukR This user is from outside of this forum
    realcainmosni@mastodon.me.uk
    wrote sidst redigeret af
    #21

    @robinhouston Ably demonstrating that machine "randomisation", isn't.

    1 Reply Last reply
    0
    • robinhouston@mathstodon.xyzR robinhouston@mathstodon.xyz

      For my birthday, my brother-in-law gave me a 4992-digit hex number that, when used as a seed for Python’s random number generator, makes it so that printing a sequence of “random” ASCII characters actually prints a birthday greeting.

      I find it rather amazing that this is possible!

      This is the program he sent with the seed:

      with open("seed.txt", encoding="ascii") as handle:
      seed = int(handle.read().strip(), 0)
      r = random.Random(seed)
      pending = ""
      while True:
      character = chr(r.randrange(128))
      if pending + character == "\x1e\x1f":
      break
      print(pending, end="")
      pending = character
      print()

      tartley@fosstodon.orgT This user is from outside of this forum
      tartley@fosstodon.orgT This user is from outside of this forum
      tartley@fosstodon.org
      wrote sidst redigeret af
      #22

      @robinhouston can you all stop boosting this wonderful thing so that I can send a version of it to my friend for his birthday?

      1 Reply Last reply
      0
      • robinhouston@mathstodon.xyzR robinhouston@mathstodon.xyz

        For my birthday, my brother-in-law gave me a 4992-digit hex number that, when used as a seed for Python’s random number generator, makes it so that printing a sequence of “random” ASCII characters actually prints a birthday greeting.

        I find it rather amazing that this is possible!

        This is the program he sent with the seed:

        with open("seed.txt", encoding="ascii") as handle:
        seed = int(handle.read().strip(), 0)
        r = random.Random(seed)
        pending = ""
        while True:
        character = chr(r.randrange(128))
        if pending + character == "\x1e\x1f":
        break
        print(pending, end="")
        pending = character
        print()

        nuintari@mastodon.bsd.cafeN This user is from outside of this forum
        nuintari@mastodon.bsd.cafeN This user is from outside of this forum
        nuintari@mastodon.bsd.cafe
        wrote sidst redigeret af
        #23

        @robinhouston A million monkeys writing Python will eventually write Happy Birthday! I love it!

        Happy Birthday!

        1 Reply Last reply
        0
        • robinhouston@mathstodon.xyzR robinhouston@mathstodon.xyz

          For my birthday, my brother-in-law gave me a 4992-digit hex number that, when used as a seed for Python’s random number generator, makes it so that printing a sequence of “random” ASCII characters actually prints a birthday greeting.

          I find it rather amazing that this is possible!

          This is the program he sent with the seed:

          with open("seed.txt", encoding="ascii") as handle:
          seed = int(handle.read().strip(), 0)
          r = random.Random(seed)
          pending = ""
          while True:
          character = chr(r.randrange(128))
          if pending + character == "\x1e\x1f":
          break
          print(pending, end="")
          pending = character
          print()

          scruss@xoxo.zoneS This user is from outside of this forum
          scruss@xoxo.zoneS This user is from outside of this forum
          scruss@xoxo.zone
          wrote sidst redigeret af
          #24

          @robinhouston a bit like Tristan Miller's very silly "The Great Commodore/Microsoft Easter
          Egg War" from 2015, which claims there are secret messages encoded in Commodore BASIC's RND() function ...
          https://www.tpug.ca/tpug-media/nl/91-Fall2015.pdf#page=7

          1 Reply Last reply
          0
          • robinhouston@mathstodon.xyzR robinhouston@mathstodon.xyz

            He's just confessed how he did it!

            https://github.com/frazerpearce/TimeLord

            lee_holmes@infosec.exchangeL This user is from outside of this forum
            lee_holmes@infosec.exchangeL This user is from outside of this forum
            lee_holmes@infosec.exchange
            wrote sidst redigeret af
            #25

            @robinhouston Very cool! If he enjoyed that, he would probably enjoy this as well - I fell into a similar rabbit hole with Python hashing 🙂

            https://www.leeholmes.com/efficiently-generating-python-hash-collisions/

            1 Reply Last reply
            0
            • niels@social.data.coopN niels@social.data.coop shared this topic
            Svar
            • Svar som emne
            Login for at svare
            • Ældste til nyeste
            • Nyeste til ældste
            • Most Votes


            • Log ind

            • Login or register to search.
            Powered by NodeBB Contributors
            Graciously hosted by data.coop
            • First post
              Last post
            0
            • Hjem
            • Seneste
            • Etiketter
            • Populære
            • Verden
            • Bruger
            • Grupper