You are here

public static function ParagonIE_Sodium_Core_Util::stringToIntArray in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Core/Util.php \ParagonIE_Sodium_Core_Util::stringToIntArray()

Turn a string into an array of integers

@internal You should not use this directly from another application

Parameters

string $string:

Return value

array<int, int>

Throws

TypeError

1 call to ParagonIE_Sodium_Core_Util::stringToIntArray()
ParagonIE_Sodium_Compat::add in vendor/paragonie/sodium_compat/src/Compat.php
Add two numbers (little-endian unsigned), storing the value in the first parameter.

File

vendor/paragonie/sodium_compat/src/Core/Util.php, line 772

Class

ParagonIE_Sodium_Core_Util
Class ParagonIE_Sodium_Core_Util

Code

public static function stringToIntArray($string) {
  if (!is_string($string)) {
    throw new TypeError('String expected');
  }

  /**
   * @var array<int, int>
   */
  $values = array_values(unpack('C*', $string));
  return $values;
}