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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:20:32+00:00 2026-06-03T17:20:32+00:00

We have a non-critical tag whose value is a string. We want to check

  • 0

We have a non-critical tag whose value is a string. We want to check the changes of the tag value. But we don’t want to do string comparison as this involves client-server and instead we want to calculate some sort of value for the string and use the value to help detect the string changes. As the string is non-critical, we wonder if there is a very simple and quick solution to calculate such value for helping on detecting changes to the string.

  • 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-03T17:20:34+00:00Added an answer on June 3, 2026 at 5:20 pm

    Use the .hashCode()

    String.hashCode() isn’t perfect because it is lossy. So it’s possible the string could change and it would have the same hashcode. (but this won’t happen often) Almost every time the string changes, its hash code will change also.

    So you know what you’re getting into, the code for String.hashCode() is this:

    public int hashCode() {
        int h = hash;  // the cached hash value
        int len = count;  // the number of characters in the string
        if (h == 0 && len > 0) {
            int off = offset;
            char val[] = value;
    
            for (int i = 0; i < len; i++) {
                h = 31*h + val[off++];
            }
            hash = h;
        }
        return h;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have non-template class with a templatized constructor. This code compiles for me. But
I have a non-rails application that I want to use rails active-record migrations with.
I have non blocking UDP socket in perl created this way my $my_sock =
I have non-sass: .rounded-corners { -moz-border-radius-topleft: 4px; and want to do something like: $radius_size:
When you have non-fixed width characters (such as \t ) in a string ,
I have an Artist model is name:string. and I want /users/1/artists/jimi-hendrix/posts instead of what
I have a best practices question. I realize this is subjective but wanted to
I have this set of html and css. What I want is to have
I have been banging my head against this for some time now: I want
I'd like to have a super simple / fast encrypt/decrypt function for non-critical pieces

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.