You are here

public static function SimpleLdap::hashes in Simple LDAP 8

Returns an array of supported hash types.

The keys of this array are also the values supported by SimpleLdap::hash(). The values are translated, human-readable values.

1 call to SimpleLdap::hashes()
SimpleLdapSsoSettingsForm::buildForm in modules/simple_ldap_sso/src/Form/SimpleLdapSSOSettingsForm.php
Form constructor.

File

src/SimpleLdap.php, line 178

Class

SimpleLdap
A wrapper for PHP's LDAP functions, with associated helper methods.

Namespace

Drupal\simple_ldap

Code

public static function hashes() {
  $types = array();

  // Crypt, and Salted Crypt.
  $types['crypt'] = t('Crypt');
  $types['salted crypt'] = t('Salted Crypt');

  // Extended DES.
  if (defined('CRYPT_EXT_DES') || CRYPT_EXT_DES == 1) {
    $types['extended des'] = t('Extended DES');
  }

  // MD5Crypt.
  if (defined('CRYPT_MD5') || CRYPT_MD5 == 1) {
    $types['md5crypt'] = t('MD5Crypt');
  }

  // Blowfish.
  if (defined('CRYPT_BLOWFISH') || CRYPT_BLOWFISH == 1) {
    $types['blowfish'] = t('Blowfish');
  }

  // MD5
  $types['md5'] = t('MD5');

  // SMD5.
  $types['salted md5'] = t('Salted MD5');

  // SHA.
  $types['sha'] = t('SHA');

  // SSHA.
  $types['salted sha'] = t('Salted SHA');

  // Unicode (used by Active Directory).
  $types['unicode'] = t('Unicode');
  return $types;
}