Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
::ConstantTime ParagonIE::ConstantTime

Functions

static decode ($encoded_string)
 Convert a binary string into a hexadecimal string without cache-timing leaks.
 
static decode5Bits ($src)
 Uses bitwise operators instead of table-lookups to turn 5-bit integers into 8-bit integers.
 
static decode5BitsUpper ($src)
 Uses bitwise operators instead of table-lookups to turn 5-bit integers into 8-bit integers.
 
static decodeUpper ($src, $strictPadding=false)
 Decode an uppercase Base32-encoded string into raw binary.
 
static doDecode ($src, $upper=false, $strictPadding=true)
 Base32 decoding.
 
static doEncode ($src, $upper=false, $pad=true)
 Base32 Decoding.
 
static encode ($src)
 Encode into Base32 (RFC 4648)
 
static encode5Bits ($src)
 Uses bitwise operators instead of table-lookups to turn 8-bit integers into 5-bit integers.
 
static encode5BitsUpper ($src)
 Uses bitwise operators instead of table-lookups to turn 8-bit integers into 5-bit integers.
 
static encodeUnpadded ($src)
 Encode into Base32 (RFC 4648)
 
static encodeUpper ($src)
 Encode into uppercase Base32 (RFC 4648)
 
static encodeUpperUnpadded ($src)
 Encode into uppercase Base32 (RFC 4648)
 
static safeSubstr ( $str, $start=0, $length=null)
 Safe substring.
 

Variables

*Copyright(c) 2016 - 2017 Paragon Initiative Enterprises. *Copyright(c) 2014 Steve "Sc00bz" Thomas(steve at tobtu dot com) **Permission is hereby granted free of charge
 
*Copyright(c) 2016 - 2017 Paragon Initiative Enterprises. *Copyright(c) 2014 Steve "Sc00bz" Thomas(steve at tobtu dot com) **Permission is hereby granted free of charge
 
*Copyright(c) 2016 - 2017 Paragon Initiative Enterprises. *Copyright(c) 2014 Steve "Sc00bz" Thomas(steve at tobtu dot com) **Permission is hereby granted free of charge
 
 else
 
*Copyright(c) 2016 - 2017 Paragon Initiative Enterprises. *Copyright(c) 2014 Steve "Sc00bz" Thomas(steve at tobtu dot com) **Permission is hereby granted free of to any person obtaining a copy *of this software and associated documentation files(the "Software") to deal *in the Software without restriction
 
*Copyright(c) 2016 - 2017 Paragon Initiative Enterprises. *Copyright(c) 2014 Steve "Sc00bz" Thomas(steve at tobtu dot com) **Permission is hereby granted free of to any person obtaining a copy *of this software and associated documentation files(the "Software") to deal *in the Software without restriction
 
*Copyright(c) 2016 - 2017 Paragon Initiative Enterprises. *Copyright(c) 2014 Steve "Sc00bz" Thomas(steve at tobtu dot com) **Permission is hereby granted free of to any person obtaining a copy *of this software and associated documentation files(the "Software") to deal *in the Software without restriction
 

Detailed Description

Function Documentation

◆ decode()

static decode ( $encoded_string)
static

Convert a binary string into a hexadecimal string without cache-timing leaks.

Parameters
string$encoded_string
Return values
string(raw binary)

◆ decode5Bits()

static decode5Bits ( $src)
staticprotected

Uses bitwise operators instead of table-lookups to turn 5-bit integers into 8-bit integers.

Parameters
int$src
Return values
int

◆ decode5BitsUpper()

static decode5BitsUpper ( $src)
staticprotected

Uses bitwise operators instead of table-lookups to turn 5-bit integers into 8-bit integers.

Uppercase variant.

Parameters
int$src
Return values
int

◆ decodeUpper()

static decodeUpper ( $src,
$strictPadding = false )
static

Decode an uppercase Base32-encoded string into raw binary.

Parameters
string$src
bool$strictPadding
Return values
string

◆ doDecode()

static doDecode ( $src,
$upper = false,
$strictPadding = true )
staticprotected

Base32 decoding.

Parameters
string$src
bool$upper
bool$strictPadding
Return values
string

◆ doEncode()

static doEncode ( $src,
$upper = false,
$pad = true )
staticprotected

Base32 Decoding.

Parameters
string$src
bool$upper
bool$pad
Return values
string

◆ encode()

static encode ( $src)
static

Encode into Base32 (RFC 4648)

Parameters
string$src
Return values
string

◆ encode5Bits()

static encode5Bits ( $src)
staticprotected

Uses bitwise operators instead of table-lookups to turn 8-bit integers into 5-bit integers.

Parameters
int$src
Return values
string

◆ encode5BitsUpper()

static encode5BitsUpper ( $src)
staticprotected

Uses bitwise operators instead of table-lookups to turn 8-bit integers into 5-bit integers.

Uppercase variant.

Parameters
int$src
Return values
string

◆ encodeUnpadded()

static encodeUnpadded ( $src)
static

Encode into Base32 (RFC 4648)

Parameters
string$src
Return values
string
Exceptions
TypeError

◆ encodeUpper()

static encodeUpper ( $src)
static

Encode into uppercase Base32 (RFC 4648)

Parameters
string$src
Return values
string

◆ encodeUpperUnpadded()

static encodeUpperUnpadded ( $src)
static

Encode into uppercase Base32 (RFC 4648)

Parameters
string$src
Return values
string
Exceptions
TypeError

◆ safeSubstr()

static safeSubstr ( $str,
$start = 0,
$length = null )
static

Safe substring.

mbstring.func_overload

@staticvar boolean $exists

Parameters
string$str
int$start
int$length
Return values
string
Exceptions
TypeError

Variable Documentation

◆ else

else
Initial value:
{
return (int) strlen($str)