public function getYubikeyId($otp) {
    if(!$this->validOtp($otp)) {
      return false;
    }

    $idLen = strlen($otp) - 32;
    return substr($otp, 0, $idLen);
  }
public function getYubikeyId($otp) {
    if(!$this->validOtp($otp)) {
      return false;
    }

    $idLen = strlen($otp) - 32;
    return substr($otp, 0, $idLen);
  }
public function getYubikeyId ( $ otp ) { if ( ! $ this -> validOtp ( $ otp ) ) { return false ; } $ idLen = strlen ( $ otp ) - 32 ; return substr ( $ otp , 0 , $ idLen ) ; }
Get the identity of a Yubikey OTP.
The identity part is the same for every OTP, and it is the initial 2-16 modhex characters of the OTP.
Since the rest of the OTP is always 32 characters, the method to extract the identity is to remove
32 characters from the end and then use the remaining string, which should be 2-16 characters,
as the YubiKey identity.

@param string $otp
The one time password to get the identity from.

@return string
Returns the Yubikey identity, or false on failure.
Get the identity of a Yubikey OTP . The identity part is the same for every OTP and it is the initial 2 - 16 modhex characters of the OTP . Since the rest of the OTP is always 32 characters the method to extract the identity is to remove 32 characters from the end and then use the remaining string which should be 2 - 16 characters as the YubiKey identity .