> */ final class EncodeUtil { /** * @param non-empty-string $text Text must be valid UTF-8 string. * * @psalm-return NonEmptyByteVector */ public static function toBytes(string $text): array { return array_map(hexdec(...), str_split(bin2hex($text), 2)); } }