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 202197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:15:57+00:00 2026-05-11T17:15:57+00:00

Possible Duplicate: How do I generate a hashcode from a byte array in c#

  • 0

Possible Duplicate:
How do I generate a hashcode from a byte array in c#

In C#, I need to create a Hash of an image to ensure it is unique in storage.

I can easily convert it to a byte array, but unsure how to proceed from there.

Are there any classes in the .NET framework that can assist me, or is anyone aware of some efficient algorithms to create such a unique hash?

  • 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-11T17:15:58+00:00Added an answer on May 11, 2026 at 5:15 pm

    There’s plenty of hashsum providers in .NET which create cryptographic hashes – which satisifies your condition that they are unique (for most purposes collision-proof). They are all extremely fast and the hashing definitely won’t be the bottleneck in your app unless you’re doing it a trillion times over.

    Personally I like SHA1:

    public static string GetHashSHA1(this byte[] data)
    {
        using (var sha1 = new System.Security.Cryptography.SHA1CryptoServiceProvider())
        {
            return string.Concat(sha1.ComputeHash(data).Select(x => x.ToString("X2")));
        }
    }
    

    Even when people say one method might be slower than another, it’s all in relative terms. A program dealing with images definitely won’t notice the microsecond process of generating a hashsum.

    And regarding collisions, for most purposes this is also irrelevant. Even "obsolete" methods like MD5 are still highly useful in most situations. Only recommend not using it when the security of your system relies on preventing collisions.

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

Sidebar

Ask A Question

Stats

  • Questions 219k
  • Answers 219k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It shouldn't be an issue. Assuming the drop down is… May 12, 2026 at 11:45 pm
  • Editorial Team
    Editorial Team added an answer There are a couple unit tests for behavior in this… May 12, 2026 at 11:45 pm
  • Editorial Team
    Editorial Team added an answer How about Vector.Delete( i ) ? May 12, 2026 at 11:45 pm

Related Questions

Possible Duplicate: How do you generate dynamic (parameterized) unit tests in Python? Is there
I am writing an algorithm to generate combinations of items from a database. They
Let's say I have a class of 30 students and want generate every possible
Possible Duplicate: How to compare two word documents? How can you get the diff

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.