question: 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 ( ) ) ) ; }
target:  Stage one password hashing, used in MySQL 4.1 password handling