Android Hash Code Calculate computeWeakHash(String string)

Here you can find the source of computeWeakHash(String string)

Description

compute Weak Hash

License

Open Source License

Declaration

public static String computeWeakHash(String string) 

Method Source Code

//package com.java2s;
/*//from  ww  w  . ja  va2 s  . com
 * Copyright 2014 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.Locale;

public class Main {
    public static String computeWeakHash(String string) {
        return String.format(Locale.US, "%08x%08x", string.hashCode(),
                string.length());
    }
}

Related

  1. hashCode(int x, int y, int z, int w, int t)
  2. hashCode(int[] array)
  3. hashLocationMessage(String phone, double latitude, double longitude, long time)
  4. hashPointOfInterestMessage(String phone, double latitude, double longitude, String title, String description)
  5. computeWeakHash(String string)
  6. getHash(String text)
  7. getHashCode(final Object... pObjects)
  8. getHashCode(final byte... pBytes)
  9. getHashStringFromId(String id)