Overview

Namespaces

  • PHP
  • PHPassLib
    • Application
    • Exception
    • Hash
    • Test
      • Application
      • Hash

Classes

  • Loader
  • Utilities

Interfaces

  • Exception
  • Hash
  • Overview
  • Namespace
  • Class
  • Tree

Class Utilities

Misc. Utilities

Namespace: PHPassLib
Package: PHPassLib\Utilities
Copyright: Copyright (c) 2012, Ryan Chouinard
License: License - http://www.opensource.org/licenses/mit-license.php
Author: Ryan Chouinard <rchouinard@gmail.com>
Located at src/PHPassLib/Utilities.php
Methods summary
public static string
# genRandomBytes( integer $count )

Generate a random string of raw bytes.

Generate a random string of raw bytes.

Parameters

$count
integer
$count Number of bytes to generate.

Returns

string
Random string of raw bytes.
public static string
# altBase64Encode( string $data )

Encode a string with alternate base64 encoding.

Encode a string with alternate base64 encoding.

Parameters

$data
string
$data String to encode.

Returns

string
Encoded string.
public static string
# altBase64Decode( string $data )

Decode a string which has been encoded with alternate base64 encoding.

Decode a string which has been encoded with alternate base64 encoding.

Parameters

$data
string
$data String to decode.

Returns

string
Decoded string.

Throws

RuntimeException
Throws an InvalidArgumentExceoption if invalid data is passed in.
public static string
# encode64( string $bytes, string $charset = null )

Encode a string.

Encode a string.

Parameters

$bytes
string
$bytes String to encode.
$charset
string
$charset Optional character set used when encoding.

Returns

string
Encoded string.
public static string
# encodeInt24( integer $integer )

Encode a 24-bit integer into a 4-byte string.

Encode a 24-bit integer into a 4-byte string.

Parameters

$integer
integer
$integer Integer to encode.

Returns

string
Encoded string.

Throws

PHPassLib\Exception\InvalidArgumentException
Throws an InvalidArgumentException if the supplied argument is not a 24-bit integer.
public static integer
# decodeInt24( string $string )

Decodes a 4-byte string into a 24-bit integer.

Decodes a 4-byte string into a 24-bit integer.

Parameters

$string
string
$string String to decode.

Returns

integer
Decoded integer.

Throws

PHPassLib\Exception\InvalidArgumentException
Throws an InvalidArgumentException if the supplied argument is not a valid encoded integer.
Constants summary
string CHARS_H64 './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
#
PHP Password Library API documentation generated by ApiGen 2.8.0