If you handle password encryption on your side, then yes, you can use it for whatever encryption method you want.
For MD5: $ pass_ldap = '{MD5}'. base64_encode (package ('H *', md5 ($ pass)));
For SHA-1: $ pass_ldap = '{SHA}'. base64_encode (pack ('H *', sha1 ($ pass)));
Then you used ldap_modify to update an existing user password or ldap_add to add a new user with an encrypted password.
I did this, and I think the LDAP server uses the value "{}" to determine which format is used.
source share