Class ByteArray
- SplFixedArray implements Iterator, Traversable, ArrayAccess, Countable
-
Aws\Crypto\Polyfill\ByteArray uses Aws\Crypto\Polyfill\NeedsTrait
- Namespace: Aws\Crypto\Polyfill
- Located at Crypto/Polyfill/ByteArray.php
Class ByteArray
Methods Summary
-
__construct ( int|string|int[] $size = 0 )
ByteArray constructor.
-
static
enc32be ( int $num )
Encode an integer into a byte array. 32-bit (unsigned), big endian byte order.
- equals ( Aws\Crypto\Polyfill\ByteArray $other )
- exclusiveOr ( Aws\Crypto\Polyfill\ByteArray $array )
-
getIncremented ( int $increase = 1 )
Returns a new ByteArray incremented by 1 (big endian byte order).
- offsetSet ( $index, $newval )
-
rshift ( )
Return a copy of this ByteArray, bitshifted to the right by 1. Used in Gmac.
-
static
select ( int $select, Aws\Crypto\Polyfill\ByteArray $left, Aws\Crypto\Polyfill\ByteArray $right )
Constant-time conditional select. This is meant to read like a ternary operator.
-
set ( Aws\Crypto\Polyfill\ByteArray $input, int $offset = 0, int|null $length = null )
Overwrite values of this ByteArray based on a separate ByteArray, with a given starting offset and length.
-
slice ( int $start = 0, null $length = null )
Returns a slice of this ByteArray.
-
zeroize ( )
Mutates the current state and sets all values to zero.
-
toString ( )
Converts the ByteArray to a raw binary string.
Methods inherited from SplFixedArray
__wakeup()
,
count()
,
current()
,
fromArray()
,
getSize()
,
key()
,
next()
,
offsetExists()
,
offsetGet()
,
offsetUnset()
,
rewind()
,
setSize()
,
toArray()
,
valid()
Methods used from Aws\Crypto\Polyfill\NeedsTrait
Methods Details
__construct ( integer|string|int[] $size = 0 )
ByteArray constructor.
Parameters
integer|string|int[] | $size = 0 | If you pass in an integer, it creates a ByteArray of that size. If you pass in a string or array, it converts it to an array of integers between 0 and 255. |
Exceptions
InvalidArgumentException |
Overrides
SplFixedArray::__construct
static
Aws\Crypto\Polyfill\ByteArray
enc32be (
integer
$num
)
Encode an integer into a byte array. 32-bit (unsigned), big endian byte order.
Parameters
integer | $num |
Returns
Aws\Crypto\Polyfill\ByteArray |
boolean
equals (
Aws\Crypto\Polyfill\ByteArray
$other
)
Aws\Crypto\Polyfill\ByteArray
exclusiveOr (
Aws\Crypto\Polyfill\ByteArray
$array
)
Aws\Crypto\Polyfill\ByteArray
getIncremented (
integer
$increase = 1
)
Returns a new ByteArray incremented by 1 (big endian byte order).
Parameters
integer | $increase = 1 |
Returns
Aws\Crypto\Polyfill\ByteArray |
offsetSet ( $index, $newval )
Overrides
SplFixedArray::offsetSet
Aws\Crypto\Polyfill\ByteArray
rshift (
)
Return a copy of this ByteArray, bitshifted to the right by 1. Used in Gmac.
Returns
Aws\Crypto\Polyfill\ByteArray |
static
Aws\Crypto\Polyfill\ByteArray
select (
integer
$select,
Aws\Crypto\Polyfill\ByteArray
$left,
Aws\Crypto\Polyfill\ByteArray
$right
)
Constant-time conditional select. This is meant to read like a ternary operator.
$z = ByteArray::select(1, $x, $y); // $z is equal to $x $z = ByteArray::select(0, $x, $y); // $z is equal to $y
Parameters
integer | $select | |
Aws\Crypto\Polyfill\ByteArray |
$left | |
Aws\Crypto\Polyfill\ByteArray |
$right |
Returns
Aws\Crypto\Polyfill\ByteArray |
Aws\Crypto\Polyfill\ByteArray
set (
Aws\Crypto\Polyfill\ByteArray
$input,
integer
$offset = 0,
integer|null
$length = null
)
Overwrite values of this ByteArray based on a separate ByteArray, with a given starting offset and length.
See JavaScript's Uint8Array.set() for more information.
Parameters
Aws\Crypto\Polyfill\ByteArray |
$input | |
integer | $offset = 0 | |
integer|null | $length = null |
Returns
Aws\Crypto\Polyfill\ByteArray |
Aws\Crypto\Polyfill\ByteArray
slice (
integer
$start = 0,
null
$length = null
)
Returns a slice of this ByteArray.
Parameters
integer | $start = 0 | |
null | $length = null |
Returns
Aws\Crypto\Polyfill\ByteArray |
zeroize ( )
Mutates the current state and sets all values to zero.
string toString ( )
Converts the ByteArray to a raw binary string.
Returns
string |