1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
asn.php
См. документацию.
1
<?
2
class
CASNReader
3
{
4
protected
$value
;
5
6
public
function
__construct
(
$value
=
''
)
7
{
8
$this->value =
$value
;
9
}
10
11
public
function
Read
(&$buf)
12
{
13
self::ReadByte
($buf);
14
$size =
self::ReadByte
($buf);
15
16
if
($size > 127)
17
{
18
$sizeLen = $size - 0x80;
19
$size =
self::ToInt
(self::ReadBytes($buf, $sizeLen));
20
}
21
22
$this->value =
self::ReadBytes
($buf, $size);
23
}
24
25
protected
static
function
ReadBytes
(&$buf, $len)
26
{
27
$res
= substr($buf, 0, $len);
28
$buf = substr($buf, $len);
29
30
return
$res
;
31
}
32
33
protected
static
function
ReadByte
(&$buf)
34
{
35
return
ord(self::ReadBytes($buf, 1));
36
}
37
38
protected
static
function
ToInt
($bin)
39
{
40
$result
= 0;
41
$len = strlen($bin);
42
for
(
$i
=0;
$i
<$len;
$i
++)
43
{
44
$byte =
self::ReadByte
($bin);
45
$result
+= $byte << (($len-
$i
-1)*8);
46
}
47
return
$result
;
48
}
49
50
public
function
GetValue
()
51
{
52
$result
=
$this->value
;
53
if
(ord(
$result
[0]) == 0x00)
54
$result
= substr(
$result
, 1);
55
return
$result
;
56
}
57
58
public
function
GetSequence
()
59
{
60
$arResult
=
array
();
61
$val
=
$this->value
;
62
while
(
$val <>
''
)
63
{
64
$sequence =
new
CASNReader
();
65
$sequence->Read(
$val
);
66
$arResult
[] = $sequence;
67
}
68
return
$arResult
;
69
}
70
}
71
?>
$arResult
$arResult
Определения
generate_coupon.php:16
CASNReader
Определения
asn.php:3
CASNReader\ReadByte
static ReadByte(&$buf)
Определения
asn.php:33
CASNReader\$value
$value
Определения
asn.php:4
CASNReader\GetSequence
GetSequence()
Определения
asn.php:58
CASNReader\GetValue
GetValue()
Определения
asn.php:50
CASNReader\Read
Read(&$buf)
Определения
asn.php:11
CASNReader\__construct
__construct($value='')
Определения
asn.php:6
CASNReader\ReadBytes
static ReadBytes(&$buf, $len)
Определения
asn.php:25
CASNReader\ToInt
static ToInt($bin)
Определения
asn.php:38
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$res
$res
Определения
filter_act.php:7
$result
$result
Определения
get_property_values.php:14
$i
$i
Определения
factura.php:643
$val
$val
Определения
options.php:1793
bitrix
modules
main
classes
general
asn.php
Создано системой
1.14.0