Download the PHP package acamposm/ipv4-address-converter without Composer

On this page you can find all versions of the php package acamposm/ipv4-address-converter. 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 ipv4-address-converter

IPv4 Address Converter

License Latest Stable Version Latest Unstable Version Build Status Scrutinizer Code Quality StyleCI Total Downloads

This PHP package allows you to perform IPv4 Address conversion within Laravel applications.

Features

The package accepts an IP address as an input and converts it to a specified IP address format.
The input and output can be one of these formats: binary string, dotted decimal, hexadecimal string, or long integer

Conversions

Converts from:

Converts to:

Installation

You can install the package via composer and then publish the assets:

Add the library to your composer.json file:

Or use composer to install the library:

Note: We try to follow SemVer v2.0.0.

Usage

Input Methods

These are the valid input methods for the conversion of the IP Addresses.

fromBinary

Set the input for the IP Address conversion as a binary string.

accepts string $address
returns IPv4AddressConverter

fromDecimal

Set the input for the IP Address conversion as a doted decimal string.

accepts string $address
returns IPv4AddressConverter

fromHexadecimal

Set the input for the IP Address conversion as a hexadecimal string.

accepts string $address
returns IPv4AddressConverter

fromLong

Set the input for the IP Address conversion as a long integer.

accepts string $address
returns IPv4AddressConverter

Output Methods

These methods are valid output methods for the conversion of the IP address specified in the previous input methods.

toBinary

Set binary string as desired output format.

toDecimal

Set dotted decimal as desired output format.

toHexadecimal

Set hexadecimal string as desired output format.

toLong

Set long integer as desired output format.

Modifiers

With these modifiers we can control the output of the conversion operation.

withDotNotation

This modifier will apply dot notation to the output of the conversion, only available to binary strings and hexadecimal strings.

Sample outputs

From Decimal to Long Integer

This example shows how to convert a dotted-decimal IP address to a long integer IP address.

The output of the conversion is a integer.

From Decimal to Binary String

This example shows how to convert a dotted decimal IP address to binary string IP address.

The output is a binary string IP Address.

From Decimal to Binary String with Dot Notation

This example shows how to convert a dotted-decimal IP address to binary string IP address with dot notation.

The output is a binary string IP Address with dot notation.

From Decimal to Hexadecimal

This example shows how to convert a dotted-decimal IP address to a hexadecimal string IP address.

The output of the conversion is a hexadecimal string IP address.

From Decimal to Hexadecimal with Dot Notation

This example shows how to convert a dotted-decimal IP address to a hexadecimal string IP address with dot notation.

The output of the conversion is a hexadecimal string IP address with dot notation.

Output All

There's an all method, that converts an input address to all formats.
The input address for the conversion can be a binary, decimal, hexadecimal or long address.

The output is an object with the address converted to all formats.

Testing

To run the tests you only need to run this command:

Changelog

Please see CHANGELOG.md for more information what has changed recently.

Contributing

Thank you for considering contributing to the improvement of the package. Please see CONTRIBUTING.md for details.

Security Vulnerabilities

If you discover any security related issues, please send an e-mail to Angel Campos via [email protected] instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

Standards

The php package IPv4 Address Converter, comply with the next standards:

Credits

Angel Campos

License

The package IPv4 Address Converter is an open-source package and is licensed under The MIT License (MIT). Please see License File for more information.


All versions of ipv4-address-converter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
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 acamposm/ipv4-address-converter contains the following files

Loading the files please wait ....