1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
asn.php
См. документацию.
1<?
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 {
53 if(ord($result[0]) == 0x00)
54 $result = substr($result, 1);
55 return $result;
56 }
57
58 public function GetSequence()
59 {
60 $arResult = array();
62 while($val <> '')
63 {
64 $sequence = new CASNReader();
65 $sequence->Read($val);
66 $arResult[] = $sequence;
67 }
68 return $arResult;
69 }
70}
71?>
$arResult
Определения generate_coupon.php:16
Определения asn.php:3
static ReadByte(&$buf)
Определения asn.php:33
$value
Определения asn.php:4
GetSequence()
Определения asn.php:58
GetValue()
Определения asn.php:50
Read(&$buf)
Определения asn.php:11
__construct($value='')
Определения asn.php:6
static ReadBytes(&$buf, $len)
Определения asn.php:25
static ToInt($bin)
Определения asn.php:38
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$result
Определения get_property_values.php:14
$i
Определения factura.php:643
$val
Определения options.php:1793