Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Encoding

Fonctions membres publiques statiques

static binToHex ($byte_string)
 
static hexToBin ($hex_string)
 
static trimTrailingWhitespace ($string='')
 
static saveBytesToChecksummedAsciiSafeString ($header, $bytes)
 
static loadBytesFromChecksummedAsciiSafeString ($expected_header, $string)
 

Champs de données

const CHECKSUM_BYTE_SIZE = 32
 
const CHECKSUM_HASH_ALGO = 'sha256'
 
const SERIALIZE_HEADER_BYTES = 4
 

Documentation des fonctions membres

◆ binToHex()

static binToHex (   $byte_string)
static

Converts a byte string to a hexadecimal string without leaking information through side channels.

Paramètres
string$byte_string
Exceptions
Ex

Références $b, $c, $i, et Core\ourStrlen().

Référencé par Crypto\encryptInternal(), Core\pbkdf2(), et Encoding\saveBytesToChecksummedAsciiSafeString().

◆ hexToBin()

static hexToBin (   $hex_string)
static

Converts a hexadecimal string into a byte string without leaking information through side channels.

Paramètres
string$hex_string
Exceptions
Ex

Références $c, $state, et Core\ourStrlen().

Référencé par RuntimeTests\AESTestVector(), RuntimeTests\HKDFTestVector(), et Encoding\loadBytesFromChecksummedAsciiSafeString().

◆ loadBytesFromChecksummedAsciiSafeString()

static loadBytesFromChecksummedAsciiSafeString (   $expected_header,
  $string 
)
static

INTERNAL USE ONLY: Decodes, verifies the header and checksum, and returns the encoded byte string.

Paramètres
string$expected_header
string$string
Exceptions
Ex

Références Core\ensureTrue(), Core\hashEquals(), Encoding\hexToBin(), Core\ourStrlen(), et Core\ourSubstr().

Référencé par Key\loadFromAsciiSafeString(), et KeyProtectedByPassword\loadFromAsciiSafeString().

◆ saveBytesToChecksummedAsciiSafeString()

static saveBytesToChecksummedAsciiSafeString (   $header,
  $bytes 
)
static

INTERNAL USE ONLY: Applies a version header, applies a checksum, and then encodes a byte string into a range of printable ASCII characters.

Paramètres
string$header
string$bytes
Exceptions
Ex

Références $header, Encoding\binToHex(), Core\ensureTrue(), et Core\ourStrlen().

Référencé par Key\saveToAsciiSafeString(), et KeyProtectedByPassword\saveToAsciiSafeString().

◆ trimTrailingWhitespace()

static trimTrailingWhitespace (   $string = '')
static

Remove trialing whitespace without table look-ups or branches.

Calling this function may leak the length of the string as well as the number of trailing whitespace characters through side-channels.

Paramètres
string$string
Renvoie
string

Références $last, Core\ourStrlen(), et Core\ourSubstr().

Référencé par Key\loadFromAsciiSafeString().

Documentation des champs

◆ CHECKSUM_BYTE_SIZE

const CHECKSUM_BYTE_SIZE = 32

◆ CHECKSUM_HASH_ALGO

const CHECKSUM_HASH_ALGO = 'sha256'

◆ SERIALIZE_HEADER_BYTES

const SERIALIZE_HEADER_BYTES = 4

La documentation de cette classe a été générée à partir du fichier suivant :