/** * @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); }