Java Hash String hash(String name)

Here you can find the source of hash(String name)

Description

Hashes the specified string into an integer used to identify an ArchiveEntry .

License

Open Source License

Parameter

Parameter Description
name The name of the entry.

Return

The hash.

Declaration

public static int hash(String name) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//  www. j av  a 2s.  co  m
     * Hashes the specified string into an integer used to identify an {@link ArchiveEntry}.
     *
     * @param name The name of the entry.
     * @return The hash.
     */
    public static int hash(String name) {
        return name.toUpperCase().chars().reduce(0, (hash, character) -> hash * 61 + character - 32);
    }
}

Related

  1. hash(final String s1, final String s2, final String[] a)
  2. hash(String arg)
  3. hash(String data)
  4. hash(String data)
  5. hash(String password)
  6. hash(String s)
  7. hash(String s)
  8. hash(String s, int start, int end)