Android String Hash hashIt(String s)

Here you can find the source of hashIt(String s)

Description

hash It

Declaration

public static Hashtable hashIt(String s) 

Method Source Code

//package com.java2s;

import java.util.Hashtable;

public class Main {
    public static Hashtable hashIt(String s) {
        Hashtable ht = new Hashtable();
        int i = 0, a = 0, b = 0, c = 0;
        if (s.length() > 0) {
            while (i < s.length()) {
                a = i;//from   w w  w . ja v  a  2 s. c  o  m
                while (s.charAt(i) != '=' && i < s.length()) {
                    i++;
                }
                b = i;
                while (s.charAt(i) != '&' && i < (s.length() - 1)) {
                    i++;
                }
                if (i < (s.length() - 1)) {
                    c = i;
                } else {
                    c = i + 1;
                }
                ht.put(s.substring(a, b), s.substring(b + 1, c));
                i++;
            }
        }
        return ht;
    }
}

Related

  1. hash(String text, String algorithm)
  2. hashKeyForDisk(String key)
  3. generateHash(String pText)
  4. hashAlgorithm(String hash, String text)