/** * @depends testBinaryConversion */ public function testIPv6ToBinary() { $testData = Helpers::ipv6ToBinary($this->ipv6); $this->assertTrue(Helpers::bin2hex($testData) === $this->ipv6_converted); }
/** * @param string $message * @param string $signer_private * @return string The signature of the message. * @throws InvalidTypeException */ public static function sign($message, $signer_private) { # Test to make sure all the required variables are strings. Helpers::isString($message, 'PublicKeyEncryption', 'sign'); Helpers::isString($signer_private, 'PublicKeyEncryption', 'sign'); return base64_encode(Helpers::bin2hex(\Sodium\crypto_sign_detached($message, $signer_private))); }