For my program i ask for a Username and Password so they can log in. However i hash the password before sending it anywhere.

Java Code:
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class PassHasher{

    public static String PassHasher(String input)	{
        try {
            MessageDigest md = MessageDigest.getInstance("SHA1");
            md.reset();
            byte[] buffer = input.getBytes();
            md.update(buffer);
            byte[] digest = md.digest();
            String hexStr = "";
            for (int i = 0; i < digest.length; i++) {
                hexStr += Integer.toString((digest[i] & 0xff) + 0x100, 16).substring(1);
            }
            return hexStr;
        } catch (NoSuchAlgorithmException ex) {
            Logger.getLogger(PassHasher.class.getName()).log(Level.SEVERE, null, ex);
        }
        return "";
	}
}
However after typing is the word 'pass' four times and reading the results on my termnial i have the following four outputs.

395f718302d95fbc3dbcc8315048ff08a58ee2bf
fca7974df7d038d96da5fec6c473c7e6397cc6ff
5cc9a9ec2df98e2c00356a14d39c2b6e2797b8ce
b6ae915dcd296de752d8fc2c9ce6a94060c0c127

The password is stored in a java swing password field and the following is called to extract it

String pass = Pass.getPassword().toString();

Then it;s put into the hasher and the result printed to terminal. Can someone please tell me why it's not working.