SipHash function for PHP
C PHP JavaScript M4
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
CREDITS
EXPERIMENTAL
README.md
config.m4
config.w32
php_siphash.h
siphash-impl.c
siphash-impl.h
siphash.c
siphash.php

README.md

SipHash for PHP

SipHash extension for PHP.

SipHash is a family of pseudorandom functions optimized for short inputs. Target applications include network traffic authentication and hash-table lookups protected against hash-flooding denial-of-service attacks. SipHash has well-defined security goals and competitive performance.

Usage:

sip_hash(key, message)

outputs siphash-2-4(key, message) as a 8-byte string.

sip_hash32(key, message)

truncates the value and outputs a 32-bit integer.

The key should be a 16 bytes string.

Installation

$ phpize
$ ./configure --enable-siphash
$ make install

And add extension=siphash.so to your php.ini configuration file.

This PHP extension uses FloodyBerry's basic implementation

PHP 5.6+ and PHP 7.0+ are fully supported.