Crypt_CHAP::generateChallenge()

Crypt_CHAP::generateChallenge() -- Generates a new random challenge.

概要

string Crypt_CHAP::generateChallenge ([string $varname = 'challenge' [, int $size = 8]])

説明

This method generates a new random challenge and stores it in the given property, the default size of the challenge is 8 bytes.

パラメータ

返り値

string - a String containing the challenge

注意

この関数は、スタティックにコールする ことはできません。

例 35-1Using Crypt_CHAP::generateChallenge()


<?php
require_once 'File/SMBPasswd.php';

$cr = new Crypt_CHAP_MD5();
echo bin2hex($cr->challenge);
// or generate a new challenge
echo bin2hex(echo $cr->generateChallenge());

?>