32 $buffer = new \fpoirotte\Pssht\Buffer();
64 if (!is_int($count) || $count < 0) {
65 throw new \InvalidArgumentException();
72 return $this->buffer->get($count);
87 if ($value === null) {
90 return ($value !==
"\0");
105 if ($value === null) {
108 $res = unpack(
'N', $value);
109 return array_pop($res);
125 if ($value === null) {
128 return gmp_init(bin2hex($value), 16);
147 if ($value === null) {
148 $this->buffer->unget(pack(
'N', $len));
175 $n = gmp_init(bin2hex($s), 16);
178 if (ord($s[0]) & 0x80) {
181 $n = gmp_neg(gmp_add(gmp_com($n),
"1"));
215 if (addcslashes($s,
"\x80..\xFF") !== $s) {
216 throw new \InvalidArgumentException();
220 if ($s[0] ===
',' || substr($s, -1) ===
',' ||
221 strpos($s,
',,') !==
false) {
222 throw new \InvalidArgumentException();
225 $l = explode(
',', $s);
228 if ($validationCallback !== null) {
229 call_user_func($validationCallback, $l);
__construct(\fpoirotte\Pssht\Buffer $buffer=null)
$buffer
Buffer the encoded values are read from.
decodeNameList($validationCallback=null)