Skip to main content
Participant
Jan 14, 2025 3:32 AM UTC
Answered

Is there simple way to generate many UUIDs?

I want to geneate 100+ UUIDs,is there simple way?

    Jack HandsonCorrect answer
    Participant
    Jan 14, 2025 5:44 AM UTC

    1. Use programming? it is very easy, a loop for 100 times.

    2. You can also use web online tools, just like:  generateguid.com

    5 replies

    BKBK
    Community Expert
    Community Expert
    Jan 15, 2025 1:22 PM UTC

    Using an online tool is indeed a simple way to generate many UUIDs. But you should beware of two subtle factors.

    1.  Though you may use the names UUID and GUID interchangeably, they stand for two different things. UUID = Universally Unique IDentifier and GUID = Globally Unique IDentifier.
      UUID is a universal definition, whereas GUID is a Microsoft definition.
      So, strictly speaking, you should only call it GUID when you're within a Microsoft context. Otherwise, call it UUID.

    2.  UUID has a version. You should therefore beware of which version to use.
      If version does not matter to you and you just need to generate a UUID, then Version 4 is what you want. Version 4 UUIDs are generated from random or pseudo-random numbers.

      Example of online tool to generate many UUIDs, taking version into account: Online UUID Generator.
    Translate
    Jack HandsonCorrect answer
    Participant
    Jan 14, 2025 5:44 AM UTC

    1. Use programming? it is very easy, a loop for 100 times.

    2. You can also use web online tools, just like:  generateguid.com

    Translate
    Peter_HuAuthor
    Participant
    Jan 14, 2025 5:47 AM UTC

    Yes, online web tool is my want, Thank you!

    Translate
    Charlie Arehart
    Community Expert
    Community Expert
    Jan 14, 2025 5:15 AM UTC

    It's not clear what aspect of this you're wanting help with. Is there a reason something as simple as this doesn't suit you?

     

    <cfscript>
    arr=[] 
    for (i=1;i<=100;i++){
       arrayappend(arr, CreateUUID())
    }
    writedump(arr) 
    </cfscript>

     

    Of course, that can be done in tags instead. And there's probably some clever functional programming that could effect the same result in perhaps still fewer lines. That said, if you put semicolons at the end of each line, all that code could be on a single line. 🙂 

    Translate
    /Charlie (troubleshooter, carehart. org)
    Peter_HuAuthor
    Participant
    Jan 14, 2025 5:45 AM UTC

    Thank you.

    Translate