loadBytesFromChecksummedAsciiSafeString() public static method

INTERNAL USE ONLY: Decodes, verifies the header and checksum, and returns the encoded byte string.
public static loadBytesFromChecksummedAsciiSafeString ( string $expected_header, string $string ) : string
$expected_header string
$string string
return string
示例#1
0
 /**
  * @expectedException \Defuse\Crypto\Exception\BadFormatException
  * @expectedExceptionMessage not a hex string
  */
 public function testBadHexEncoding()
 {
     $header = Core::secureRandom(Core::HEADER_VERSION_SIZE);
     $str = Encoding::saveBytesToChecksummedAsciiSafeString($header, Core::secureRandom(Core::KEY_BYTE_SIZE));
     $str[0] = 'Z';
     Encoding::loadBytesFromChecksummedAsciiSafeString($header, $str);
 }