使用 php 產生 openldap sha 密碼 hash

Using php to create openldap sha password hash

應該很少有人有這樣的需求. 不過我就是有. 下面程式可以讓你產生 ldap sha 密碼 hash :

1
2
$passwd = "TOP_SECRET";
$ldap_passwd = "{SHA}".base64_encode(pack("H*", sha1($passwd)));

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.