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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:46:53+00:00 2026-05-19T02:46:53+00:00

This is pseudo code sbyte[] array1 = new sbyte[100]; array1.setValues(); sbyte[] array2 = (sbyte[])array1.Clone();

  • 0

This is pseudo code

sbyte[] array1 = new sbyte[100]; 
array1.setValues(); 
sbyte[] array2 = (sbyte[])array1.Clone();

But array1.getHashCode() is not equal with array2.getHashCode();

What should I do to get same hash code for array1 and array2?

P.S: Dictionary isn’t useful. Because I wanted to add these arrays to a hashtable. And after each adding I need to check for a possible same content array added before.

P.S2: It seems I should clarify my problem. At first I posted the complete question at Using Hash in C# and when it was solved this question was raised.

  • 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-19T02:46:54+00:00Added an answer on May 19, 2026 at 2:46 am

    There is no way to override the GetHashCode method from the array class. But you can wrap you array inside another class and them use some of its items to specify its hash key.

    public class WrappedArray
    {
      sbyte[] _inner = new sbyte[10]
    
      //...
    
      override public int GetHashCode()
      {
        return _inner[0] ^ _inner[1] ^ _inner[2];
      }
    }
    

    It is just an idea. The hash codes don’t need to be unique for each object, because hash structures are designed to deal with collisions.

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

Sidebar

Related Questions

Hi I have below pseudo code with throws an exception like this throw new
I want to do something like this pseudo-code MyView v = new MyView(); //yeah,
I'm basically trying to do this (pseudo code, not valid python): limit = 10
Consider this pseudo code: // an image is initialized UIImage *imagePX = [[UIImage alloc]initWithContentsOfFile:...
Trying to figure out this pseudo code. The following is assumed.... I can only
Here's what I'm trying to do -- this is pseudo code and doesn't work.
Why can't I do something like this in c# (pseudo code follows) Interface1 {
The basic pseudo code looks like this: void myFunction() { int size = 10;
Given this pseudo code of a function f(0) = 1; f(1) = 3; f(n)
How can I translate this pseudo code into working JS [don't worry about where

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.