Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7935845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:02:42+00:00 2026-06-03T22:02:42+00:00

I am following a tutorial on making a simple app with Node.js and Geddy.

  • 0

I am following a tutorial on making a simple app with Node.js and Geddy. For each new entry it sets the entry id with geddy.string.uuid(10) and doesn’t seem to run any other checks. My concern is when creating a new entry this could generate the same ID as a previous entry and the save script in the tutorial will overwrite/update an entry if the id already exists.

I know this would be a rare occurrence if it could happen, but I feel it is not responsible to leave this to chance if it can. I know in PHP I would be running a check of some sort to make sure it is unique, and just wanted to know if maybe Geddy was doing this already for me being the tutorial seems to not worry about it?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:02:46+00:00Added an answer on June 3, 2026 at 10:02 pm

    There is no real chance of a uuid occurring twice.

    Technically, there is a one in 340,282,366,920,938,463,463,374,607,431,768,211,456 (16 to the 32nd power) chance that there will be a duplicate. Geddy’s uuid function (like most others) uses 32 hex digits (128 bits) of random bits. See http://en.wikipedia.org/wiki/Universally_unique_identifier#Random_UUID_probability_of_duplicates.
    Basically, you’re not going to get a duplicate.

    As a side note, it’s interesting that you’re passing 10 uuid here: geddy.string.uuid(10). In the latest version of getty string.js, uuid does not take an argument, so the 10 will be ignored.

    148   this.uuid = function () {
    149     var chars = _UUID_CHARS, uuid = [], rnd=0, r;
    150     for (var i = 0; i < 36; i++) {
    151       if (i==8 || i==13 ||  i==18 || i==23) {
    152         uuid[i] = '-';
    153       } else {
    154         if (rnd <= 0x02) rnd = 0x2000000 + (Math.random()*0x1000000)|0;
    155         r = rnd & 0xf;
    156         rnd = rnd >> 4;
    157         uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
    158       }
    159     }
    160     return uuid.join('');
    161   };
    

    If the 10 in your version of geddy is limiting the number of hex digits to 10, then you only have a 1 in 1,099,511,627,776 (1 trillion) chance of a collision. That’s still quite unlikely, though it could be brute forced to find a duplicate id.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making simple tree structure and in the tutorial is following: Build cache:
I am making a simple logging system in android. I am following this tutorial
I'm making a simple MVC component for joomla following the hello world tutorial for
I'm following tutorial, installed RanvenDB embeeded and write: public static IDocumentStore archives = new
I'm following this tutorial attempting to learn XNA, but I'm having issues making my
I've tried to get trough the following tutorial Making Operating System Calls from SQL
I'm following this tutorial about making an Ajax request on Rails: http://net.tutsplus.com/tutorials/javascript-ajax/using-unobtrusive-javascript-and-ajax-with-rails-3/ made _form
I'm following this tutorial on making an animation like IKEA: http://static.buildinternet.com/live-tutorials/interactive-picture/index.html The issue I'm
I'm following this tutorial to add a simple jquery tooltip. The tutorial uses three
Ok so I'm making a simple web app using the technologies from the topic,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.