src/Phpass/Hash/Adapter/ExtDes.php
protected function _encodeInt24($integer)
    {
        $integer = (int) $integer;
        if ($integer < 0 || $integer > 0xffffff) {
            throw new InvalidArgumentException('Integer is out of range');
        }

        $string  = $this->_itoa64[$integer & 0x3f];
        $string .= $this->_itoa64[($integer >> 0x06) & 0x3f];
        $string .= $this->_itoa64[($integer >> 0x0c) & 0x3f];
        $string .= $this->_itoa64[($integer >> 0x12) & 0x3f];

        return $string;
    }
protected function _encodeInt24($integer)
    {
        $integer = (int) $integer;
        if ($integer < 0 || $integer > 0xffffff) {
            throw new InvalidArgumentException('Integer is out of range');
        }

        $string  = $this->_itoa64[$integer & 0x3f];
        $string .= $this->_itoa64[($integer >> 0x06) & 0x3f];
        $string .= $this->_itoa64[($integer >> 0x0c) & 0x3f];
        $string .= $this->_itoa64[($integer >> 0x12) & 0x3f];

        return $string;
    }
protected function _encodeInt24 ( $ integer ) { $ integer = ( int ) $ integer ; if ( $ integer < 0 || $ integer > 0xffffff ) { throw new InvalidArgumentException ( 'Integer is out of range' ) ; } $ string = $ this -> _itoa64 [ $ integer & 0x3f ] ; $ string .= $ this -> _itoa64 [ ( $ integer >> 0x06 ) & 0x3f ] ; $ string .= $ this -> _itoa64 [ ( $ integer >> 0x0c ) & 0x3f ] ; $ string .= $ this -> _itoa64 [ ( $ integer >> 0x12 ) & 0x3f ] ; return $ string ; }
Encode a 24-bit integer as a 4-byte string.

@param integer $integer
The integer to encode. Must be between 0 and 16777215.
@return string
Returns the encoded string.
@throws InvalidArgumentException
Throws an InvalidArgumentException if the integer is outside of the
range 0 - 16777215.
Encode a 24 - bit integer as a 4 - byte string .