• Mikina@programming.dev
        link
        fedilink
        arrow-up
        9
        ·
        9 hours ago

        Aren’t UUIDs designed to prevent collisions, rather than be cryptographycally secure? Not that it’s doing a great job here :D

        Edit: Nvm, that was guid.

        • BootLoop@sh.itjust.works
          link
          fedilink
          arrow-up
          7
          ·
          edit-2
          3 hours ago

          GUID and UUID are two names of the same thing. One is Globally Unique and one is Universally Unique. I think they mean not cryptographically secure as in not truly random if it’s generating duplicates.

      • ChaoticNeutralCzech@feddit.org
        link
        fedilink
        English
        arrow-up
        4
        ·
        8 hours ago

        That would indeed be way (quadratically) more likely but we don’t count the number of attempts but measure run time, and since comparisons (even with optimizations like insertion sort) take time, the speed difference between the two methods will be “just” a few orders of magnitude.

        • redjard@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          2
          ·
          7 hours ago

          As long as you don’t run out of memory, you can actually insert and lookup in O(1) time for a known space of values (that we have). Therefore we do get the quadratic speedup, that when dealing with bits of keysize or entropy means cutting it in half.
          Checking to get a specific uuid takes 128bit, so 2128 draws of a uuid. Putting all previous uuids into a table we expect a collision in 64bit, so 264. We also need about that much storage to contain the table, so some tens of exabytes.