Git Product home page Git Product logo

guid-math's Introduction

Guid Math

Performing basic mathematic operations with GUIDs regardless of its usefulness.

Why?

My theory has always been that if Guids (UUID) can be sorted (ordered) then they can be incremented. If they can be sorted and incremented then this means there is a potential attack vector for sites that expose their guids in the URL. Guids are not as obscure as people want to make them out to be and I actually don't think it's safe to expose them. If you can find two guids from a system and subtract them, then you can iterate between the two of them and the number isn't infinity like some people like to believe. This library allows me to...

  • Add
  • Subtract
  • Multiply
  • Divide

... Guids regardless of how useful it is. This is more of a theoretical exercise.

Testing

Testing guids is very difficuilt because they are very large numbers. I have done my best to test using some set theory and mostly basic algebraic concepts.

Sequential Guid Generation

12/31/2022 Coincidentally as people are migrating from Windows docker containers to Linux docker containers due to the adoption of dot net core plus (dot net 6+) they can no longer rely on using the rpcrt4.dll which is a Windows-centric DLL. Once again, for fun, I have created a Sequential Guid generator which just utilizes the Guid Math I was working with. The performance surprised me as I wasn't expecing my library to be performant. If you are trying to generate more than one million sequential Guids at a time, then this is not the library for you. However, if it is just to generate a couple hundred it's very fast surprisingly. This is a dot net 6 library that has no dependency on Windows.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.