Recommend this page to a friend! |
Classes of Angel Campos | PHP Convert IPv4 Address | README.md | Download |
|
DownloadIPv4 Address ConverterThis PHP package allows you to perform IPv4 Address conversion within Laravel applications.
FeaturesThe 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 ConversionsConverts from:
Converts to:
InstallationYou 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. UsageInput MethodsThese are the valid input methods for the conversion of the IP Addresses. fromBinarySet the input for the IP Address conversion as a binary string. | accepts | fromDecimalSet the input for the IP Address conversion as a doted decimal string. | accepts | fromHexadecimalSet the input for the IP Address conversion as a hexadecimal string. | accepts | fromLongSet the input for the IP Address conversion as a long integer. | accepts | Output MethodsThese methods are valid output methods for the conversion of the IP address specified in the previous input methods. toBinarySet binary string as desired output format. toDecimalSet dotted decimal as desired output format. toHexadecimalSet hexadecimal string as desired output format. toLongSet long integer as desired output format. ModifiersWith these modifiers we can control the output of the conversion operation. withDotNotationThis modifier will apply dot notation to the output of the conversion, only available to binary strings and hexadecimal strings. Sample outputsFrom Decimal to Long IntegerThis 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 StringThis 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 NotationThis 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 HexadecimalThis 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 NotationThis 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 AllThere'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.
TestingTo run the tests you only need to run this command:
ChangelogPlease see CHANGELOG.md for more information what has changed recently. ContributingThank you for considering contributing to the improvement of the package. Please see CONTRIBUTING.md for details. Security VulnerabilitiesIf you discover any security related issues, please send an e-mail to Angel Campos via angel.campos.m@outlook.com instead of using the issue tracker. All security vulnerabilities will be promptly addressed. StandardsThe php package IPv4 Address Converter, comply with the next standards: CreditsAngel Campos LicenseThe package IPv4 Address Converter is an open-source package and is licensed under The MIT License (MIT). Please see License File for more information. |