Download the PHP package jesus-ag28/php-random without Composer

On this page you can find all versions of the php package jesus-ag28/php-random. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-random

PHP Random

Librería PHP para generar valores aleatorios de diferentes tipos de datos de forma criptográficamente segura.

Requisitos

Instalación

Uso Básico

Métodos Disponibles

Números

int(int $min = 0, int $max = PHP_INT_MAX): int

Genera un número entero aleatorio dentro del rango especificado.

float(float $min = 0, float $max = 1): float

Genera un número de punto flotante aleatorio.

Cadenas y Texto

string(int $length = 10): string

Genera una cadena aleatoria con caracteres alfanuméricos, especiales y españoles.

password(int $length = 10, bool $includeSpecialChars = true): string

Genera una contraseña segura.

verificationCode(int $length = 6, bool $numeric = false): string

Genera un código de verificación.

slug(int $words = 3): string

Genera un slug URL-friendly.

Tokens y UUIDs

token(int $length = 32): string

Genera un token hexadecimal.

base64Token(int $length = 32): string

Genera un token en formato Base64.

uuid(): string

Genera un UUID v4.

Booleanos y Arrays

boolean(): bool

Genera un valor booleano aleatorio.

array(int $length = 5, ?callable $valueGenerator = null): array

Genera un array de valores aleatorios.

fromArray(array $options): mixed

Selecciona un elemento aleatorio de un array.

weightedPick(array $options, array $weights): mixed

Selecciona un elemento con pesos especificados.

shuffle(array $array): array

Mezcla un array de forma criptográficamente segura.

enum(string $enumClass): mixed

Selecciona un caso aleatorio de un enum (PHP 8.1+).

Fechas y Tiempo

date(string $startDate = '1970-01-01', string $endDate = 'now'): string

Genera una fecha aleatoria.

dateTime(string $startDate = '1970-01-01 00:00:00', string $endDate = 'now'): string

Genera una fecha y hora aleatoria.

Colores

color(): string

Genera un color hexadecimal con prefijo #.

hexColor(): string

Genera un color hexadecimal sin prefijo.

Coordenadas GPS

latitude(): float

Genera una latitud aleatoria (-90 a 90).

longitude(): float

Genera una longitud aleatoria (-180 a 180).

coordinates(): array

Genera coordenadas GPS completas.

Datos de Red

email(string $domain = 'example.com'): string

Genera una dirección de correo electrónico.

ipAddress(): string

Genera una dirección IP v4 válida.

macAddress(): string

Genera una dirección MAC válida.

domainName(int $length = 10): string

Genera un nombre de dominio.

url(int $length = 10): string

Genera una URL aleatoria.

userAgent(): string

Genera un User Agent común.

Datos Personales

fullName(bool $spanish = true): string

Genera un nombre completo en español o inglés.

postalAddress(bool $spanish = true): string

Genera una dirección postal.

phoneNumber(bool $spanish = true): string

Genera un número de teléfono nacional.

internationalPhoneNumber(bool $spanish = true): string

Genera un número de teléfono internacional.

username(int|string|null $wordCount = 1, int|string|null $adjectiveCount = 1): string

Genera un nombre de usuario combinando palabras y adjetivos (700+ palabras épicas, 600+ adjetivos).

Datos Financieros

creditCardNumber(): string

Genera un número de tarjeta de crédito válido (solo para pruebas).

Utilidades

fileSize(int $minBytes = 1024, int $maxBytes = 1073741824): string

Genera un tamaño de archivo en formato legible.

Seguridad

Todos los métodos utilizan random_int() y random_bytes(), que son criptográficamente seguros (CSPRNG). Esto hace que la librería sea adecuada para generar tokens, contraseñas y otros datos sensibles.

Características

Ejemplos de Uso

Generar datos de prueba para usuarios

Generar tokens de autenticación

Generar códigos de verificación

Generar datos geográficos

Licencia

MIT

Autor

Jesús Ayús - [email protected]

Repositorio

https://github.com/jesusAG28/PHPRandom


All versions of php-random with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jesus-ag28/php-random contains the following files

Loading the files please wait ...