static byte[] passwordHashStage1(String password) throws NoSuchAlgorithmException {
  MessageDigest md=MessageDigest.getInstance("SHA-1");
  StringBuilder cleansedPassword=new StringBuilder();
  int passwordLength=password.length();
  for (int i=0; i < passwordLength; i++) {
    char c=password.charAt(i);
    if ((c == ' ') || (c == '\t')) {
      continue;
    }
    cleansedPassword.append(c);
  }
  return md.digest(StringUtils.getBytes(cleansedPassword.toString()));
}

static byte [ ] passwordHashStage1 ( String password ) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest . getInstance ( "SHA-1" ) ; StringBuilder cleansedPassword = new StringBuilder ( ) ; int passwordLength = password . length ( ) ; for ( int i = 0 ; i < passwordLength ; i ++ ) { char c = password . charAt ( i ) ; if ( ( c == ' ' ) || ( c == '\t' ) ) { continue ; } cleansedPassword . append ( c ) ; } return md . digest ( StringUtils . getBytes ( cleansedPassword . toString ( ) ) ) ; }
stage one password hashing , used in mysql 4 . 1 password handling
