common/src/main/java/HTTPClient/DefaultAuthHandler.java
/**
     * Calculates the NTCR hashed unicode password. See
     * ftp://samba.anu.edu.au/pub/samba/docs/ENCRYPTION.txt more info.
     *
     * @param passw the password
     * @return the hashed password with 5 zeros appended
     */
Calculates the NTCR hashed unicode password.

@param passw the password
@return the hashed password with 5 zeros appended
Calculates the NTCR hashed unicode password . @param passw the password @return the hashed password with 5 zeros appended
static byte[] calc_ntcr_hpw(String passw)
    {
	byte[] uc = new byte[passw.length() * 2];
	for (int idx=0, dst=0; idx<passw.length(); idx++)
	{
	    char ch = passw.charAt(idx);
	    uc[dst++] = (byte) (ch & 0xFF);
	    uc[dst++] = (byte) (ch >>> 8);
	}
	byte[] hash = new MD4(uc).getHash();
	return Util.resizeArray(hash, 21);
    }
static byte [ ] calc_ntcr_hpw ( String passw ) { byte [ ] uc = new byte [ passw . length ( ) * 2 ] ; for ( int idx = 0 , dst = 0 ; idx < passw . length ( ) ; idx ++ ) { char ch = passw . charAt ( idx ) ; uc [ dst ++ ] = ( byte ) ( ch & 0xFF ) ; uc [ dst ++ ] = ( byte ) ( ch >>> 8 ) ; } byte [ ] hash = new MD4 ( uc ) . getHash ( ) ; return Util . resizeArray ( hash , 21 ) ; }
Calculates the NTCR hashed unicode password.
Calculates the NTCR hashed unicode password .
// put password into an array of bytes, writing the unicode chars // in little endian order // calc MD4 hash of password (as unicode array)