You are here

public static function MoAuthUtilities::indentSecret in Google Authenticator / 2 Factor Authentication - 2FA 8

Same name and namespace in other branches
  1. 8.2 src/MoAuthUtilities.php \Drupal\miniorange_2fa\MoAuthUtilities::indentSecret()
1 call to MoAuthUtilities::indentSecret()
configure_google_authenticator::buildForm in src/Form/configure_google_authenticator.php
Form constructor.

File

src/MoAuthUtilities.php, line 276
This file is part of miniOrange 2FA module.

Class

MoAuthUtilities

Namespace

Drupal\miniorange_2fa

Code

public static function indentSecret($secret) {
  $strlen = strlen($secret);
  $indented = '';
  for ($i = 0; $i <= $strlen; $i = $i + 4) {
    $indented .= substr($secret, $i, 4) . ' ';
  }
  $indented = trim($indented);
  return $indented;
}