32 $buffer = new \fpoirotte\Pssht\Buffer();
60 $this->buffer->push($value);
75 return $this->
encodeBytes(((
bool) $value) ?
"\x01" :
"\x00");
104 $s = gmp_strval($value, 16);
105 $s = str_pad($s, 16,
'0', STR_PAD_LEFT);
136 if (gmp_cmp($value,
"0") == 0) {
139 $s = gmp_strval($value, 16);
140 $s = pack(
'H*', str_pad($s, ((strlen($s) + 1) >> 1) << 1,
'0', STR_PAD_LEFT));
144 if ((ord($s[0]) & 0x80) && gmp_sign($value) > 0) {
161 $s = implode(
',', $values);
166 if (addcslashes($s,
"\x80..\xFF") !== $s) {
167 throw new \InvalidArgumentException();
171 if ($s[0] ===
',' || substr($s, -1) ===
',' ||
172 strpos($s,
',,') !==
false) {
173 throw new \InvalidArgumentException();
__construct(\fpoirotte\Pssht\Buffer $buffer=null)
$buffer
Buffer where the encoded values will be appended.
encodeNameList(array $values)