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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:31:23+00:00 2026-06-08T07:31:23+00:00

Given two different strings, is it always the case that s.GetHashCode() != s1.GetHashCode() ?

  • 0

Given two different strings, is it always the case that s.GetHashCode() != s1.GetHashCode()?

Is it the case that the number of distinct integers is less than the number of distinct strings?

  • 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-08T07:31:24+00:00Added an answer on June 8, 2026 at 7:31 am

    No. Just as a simple thought experiment: How many strings are there (hint: many more than 232 and thus how many unique hash codes can there be (hint: 232. See the problem?)

    Hash codes are just required to be equal whenever Equals returns that both objects are equal. Furthermore, whenever two hash codes are not equal, then the objects themselves cannot be equal. There is no further requirement, but they should be well-distributed so that hash tables can perform well. So basically it’s:

    enter image description here

    Note the omission of the respective ⇐ variants. It’s not an equivalence, just two implications.

    To quote the documentation:

    A hash function must have the following properties:

    1. If two objects compare as equal, the GetHashCode method for each object must return the same value. However, if two objects do not compare as equal, the GetHashCode methods for the two object do not have to return different values.

    2. The GetHashCode method for an object must consistently return the same hash code as long as there is no modification to the object state that determines the return value of the object’s Equals method. Note that this is true only for the current execution of an application, and that a different hash code can be returned if the application is run again.

    3. For the best performance, a hash function must generate a random distribution for all input.

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

Sidebar

Related Questions

Given two strings of equal length such that s1 = ACCT s2 = ATCT
Given two lists of different types, is it possible to make those types convertible
Given two sorted arrays of integers, a and b , and an integer c
Given two strings text1 and text2 : public SOMEUSABLERETURNTYPE Compare(string text1, string text2) {
Given two identical widgets with different data, A and B, when the data for
I have json with field that contains two different types. fields:[{value:ZIELONE OKO},{value:{@nil:true}}] I have
Given are two python lists with strings in them (names of persons): list_1 =
Given two strings, I want to find all common substrings of a specified length,
For given number of blocks of digits (number of blocks is bigger than 2
What is the difference between these two queries? Why do they give different results?

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.