Ejemplo n.º 1
0
 /**
  * Prepare data to be sent
  *
  * @param   org.nagios.nsca.NscaMessage $message
  * @return  string
  */
 public function prepare(NscaMessage $message)
 {
     // Calculate CRC32 checksum, then build the final packet with the sig
     // and encrypt it using defined crypt method
     return $this->encrypt($this->pack(CRC32::fromString($this->pack(0, $message))->asInt32(), $message));
 }
 /**
  * Returns a checksum for a given input string
  *
  * @param   string data
  * @return  security.checksum.Checksum
  */
 protected function checksumOf($data)
 {
     return CRC32::fromString($data)->getValue();
 }