Changeset 58752 for trunk/src/wp-includes/sodium_compat/src/Core/Util.php
- Timestamp:
- 07/18/2024 12:58:40 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/sodium_compat/src/Core/Util.php
r54310 r58752 10 10 abstract class ParagonIE_Sodium_Core_Util 11 11 { 12 const U32_MAX = 0xFFFFFFFF; 13 12 14 /** 13 15 * @param int $integer … … 32 34 (($negative >> $realSize) & 1) 33 35 ); 36 } 37 38 /** 39 * @param string $a 40 * @param string $b 41 * @return string 42 * @throws SodiumException 43 */ 44 public static function andStrings($a, $b) 45 { 46 /* Type checks: */ 47 if (!is_string($a)) { 48 throw new TypeError('Argument 1 must be a string'); 49 } 50 if (!is_string($b)) { 51 throw new TypeError('Argument 2 must be a string'); 52 } 53 $len = self::strlen($a); 54 if (self::strlen($b) !== $len) { 55 throw new SodiumException('Both strings must be of equal length to combine with bitwise AND'); 56 } 57 return $a & $b; 34 58 } 35 59
Note: See TracChangeset
for help on using the changeset viewer.