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

  • SEARCH
  • Home
  • 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 6548431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:58:15+00:00 2026-05-25T11:58:15+00:00

I am saving URL’s in a database, and when i insert a new one,

  • 0

I am saving URL’s in a database, and when i insert a new one, i want to check if that url exists already in the database.

A common practice (if i’m not mistaken) is to hash the urls using md5 or sha-1 etc… and checking that field in database for duplicates prior inserting a new one.

I know md5 can produce collisions, also sha-1…

What do you suggest for me? My needs are:

  • DB Size: Eventually 10 to 20 Millions of records on database

  • Performance/Speed: Small hash size so database will not have heavy load checking for duplicates (there is going to be index of course on that field)

  • Tolerance: I don’t care if i get 1 collision on every 100,000 records. My needs are more towards performance (small hash) rather than 0% collisions (big hash).

  • Chance of attack by malformed URLs to produce collisions on purpose: Extremely Low

  • Maximum damage possible in case of such a successful attack: Extremely Low

Questions:

  • Do you believe md5 is enough (Something better to suggest)?

  • Maybe md5 is even overkill for me and i could seriously can get performance benefits by using something simpler?

Thank you in advance guys!

  • 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-05-25T11:58:16+00:00Added an answer on May 25, 2026 at 11:58 am

    What about using md5 or some similar relatively inexpensive hash (maybe Quark?), and in the rare case of collision checking the full URL for the matching entries? This way the majority of the time you just have the inexpensive hash check but you also never actually insert a duplicate URL.

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

Sidebar

Related Questions

I'm having trouble saving a new row in the DataGridView back to the database.
I'm creating a flash application that will post images to a url for saving
Hi I am saving data from rss feed url. From that me got date
Before saving an uploaded csv file I want to check it will parse. When
I want to make a URL shortener that has this URL format: http://myurlshortner.com/ {id}
For example if I am colecting a [URL value] in a form, saving that
I am trying to retrieve a saved url from a jquery cookie its saving
My Java application is saving stuff in 'user.home' but on windows this does not
Is there any way to download from a url and saving each individual chunk
I use until now this code for saving video that i get from UIImagePickerController

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.