|
static | encode ($data, $params=null) |
|
static | decode ($data, $params=null) |
|
Definition at line 33 of file Ascii85.php.
◆ decode()
static decode |
( |
|
$data, |
|
|
|
$params = null |
|
) |
| |
|
static |
Decode data
- Parameters
-
- Returns
- string
- Exceptions
-
Implements Zend_Pdf_Filter_Interface.
Definition at line 114 of file Ascii85.php.
119 $whiteSpace = array(
"\x00",
"\x09",
"\x0A",
"\x0C",
"\x0D",
"\x20");
122 if (substr(
$data, -2) !=
'~>') {
123 #require_once 'Zend/Pdf/Exception.php'; 129 $dataLength = strlen(
$data);
131 for (
$i = 0;
$i < $dataLength;
$i += 5) {
134 if (substr(
$data,
$i, 1) ==
"z") {
147 $c = unpack(
'C5', $c);
150 for ($j = 1; $j <= 5; $j++) {
151 $value += (($c[$j] - 33) * pow(85, (5 - $j)));
158 if (
$i < $dataLength) {
161 $partialLength = strlen($chunk);
165 for ($j = 0; $j < (5 - $partialLength); $j++) {
169 $c = unpack(
'C5', $chunk);
171 for ($j = 1; $j <= 5; $j++) {
172 $value += (($c[$j] - 33) * pow(85, (5 - $j)));
176 $output .= substr($foo, 0, ($partialLength - 1));
◆ encode()
static encode |
( |
|
$data, |
|
|
|
$params = null |
|
) |
| |
|
static |
Encode data
- Parameters
-
- Returns
- string
- Exceptions
-
Implements Zend_Pdf_Filter_Interface.
Definition at line 43 of file Ascii85.php.
46 $dataLength = strlen(
$data);
48 for (
$i = 0;
$i < $dataLength;
$i += 4) {
52 if (strlen($chunk) < 4) {
57 $b = unpack(
"N", $chunk);
67 for ($j = 4; $j >= 0; $j--) {
68 $foo = (int) (($b / pow(85,$j)) + 33);
75 if (
$i < $dataLength) {
76 $n = $dataLength -
$i;
77 $chunk = substr(
$data, -$n);
80 for ($j = $n;$j < 4;$j++) {
84 $b = unpack(
"N", $chunk);
88 for ($j = 4; $j >= (4 - $n); $j--) {
89 $foo = (int) (($b / pow(85,$j)) + 33);
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Pdf/Filter/Ascii85.php