wikimedia/cdb
CDB functions for PHP
Loading...
Searching...
No Matches
Cdb\Util Class Reference

Common functions for readers and writers. More...

Static Public Member Functions

static unsignedMod ( $a, $b)
 Take a modulo of a signed integer as if it were an unsigned integer.
 
static unsignedShiftRight ( $a, $b)
 Shift a signed integer right as if it were unsigned.
 
static hash ( $s)
 The CDB hash function.
 

Detailed Description

Common functions for readers and writers.

This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that appears in PHP 5.3.

Member Function Documentation

◆ hash()

static Cdb\Util::hash (   $s)
static

The CDB hash function.

Parameters
string$s
Returns
int

◆ unsignedMod()

static Cdb\Util::unsignedMod (   $a,
  $b 
)
static

Take a modulo of a signed integer as if it were an unsigned integer.

$b must be less than 0x40000000 and greater than 0

Parameters
int$a
int$b
Returns
int

◆ unsignedShiftRight()

static Cdb\Util::unsignedShiftRight (   $a,
  $b 
)
static

Shift a signed integer right as if it were unsigned.

Parameters
int$a
int$b
Returns
int

The documentation for this class was generated from the following file: