private String encodePassword(String pass) {

		if (pass == null) {
			throw new IllegalArgumentException("Argumento nulo");
		}

		try {
			MessageDigest md = MessageDigest.getInstance("SHA-1");
			md.reset();
			md.update(pass.getBytes());

			byte raw[] = md.digest();

			StringBuffer sb = new StringBuffer(raw.length * 2);
			for (int i = 0; i < raw.length; i++) {
				int v = raw[i] & 0xff;
				if (v < 16) {
					sb.append('0');
				}
				sb.append(Integer.toHexString(v));
			}
			
			return sb.toString().toUpperCase().replaceAll("\n", "");

		} catch (NoSuchAlgorithmException e) {
			throw new IllegalStateException(e.getMessage());
		}
	}