Lines Matching refs:bytes
58 $bytes = array();
68 array_push($bytes, $size | 0x80);
75 array_push($bytes, $byte);
80 array_push($bytes, $length);
84 return $bytes;
109 * @param array $bytes the byte stream
112 public static function decode($bytes) { argument
114 if (empty($bytes)) {
118 $object = ASN1DER::decodeType($bytes);
119 $length = ASN1DER::decodeLength($bytes);
121 if (count($bytes) < $length) {
125 if (count($bytes) > $length) {
129 $object->decodeDER($bytes);
142 public static function decodeLength(&$bytes) { argument
144 if (!is_array($bytes)) {
148 if (count($bytes) == 0) {
152 $length = array_shift($bytes);
169 if (count($bytes) == 0) {
173 $length = ($length << 8) + array_shift($bytes);
190 public static function decodeType(&$bytes) { argument
192 if (!is_array($bytes)) {
196 if (count($bytes) < 1) {
200 $byte = array_shift($bytes);