如何看ipv6的地址范围
怎么看ipv6的地址范围啊
我不会看ipv6的地址范围,比如下面这两个地址范围是指从哪个地址到哪个地址啊?
2406:6200::|32
240e:100::|24
为什么平时的ip库都是分开的,放在同一个表中会有什么问题吗?
------解决方案--------------------
这都是16进制表示,2字节一个:。
::表示接下来的都是0.
mysql还是可以操作的,unhex啊,substring,replace啊,看你需求了。
------解决方案--------------------
IP地址是可以按照字符串比较大小的, 要计算范围内的每一个IP, 可以gmp/bc直接当做大数运算, 我说的是PHP, 你有需求可以给你写个示例?
------解决方案--------------------
- PHP code
[User:root Time:09:54:16 Path:/home/liangdong/php]$ php ip.php 2406:6200:0000:0000:0000:0000:0000:0000[User:root Time:09:54:17 Path:/home/liangdong/php]$ cat ip.php <?php $ipv6_start = "2406:6200::"; $ipv6_end = "240e:100::"; // 扩展ipv6格式方便阅读 $bin_start = inet_pton($ipv6_start); $bin_end = inet_pton($ipv6_end); $start = unpack('H*0', $bin_start)[0]; $start = str_split($start, 4); $start = implode(":", $start); echo $start; /* 作为大数运算, 可以遍历start, end内所有IP地址 $start = gmp_init($start, 16); $end = unpack('H*0', $bin_end)[0]; $end = gmp_init($end, 16); echo gmp_strval($start, 16); */ ?> <br><font color="#e78608">------解决方案--------------------</font><br>
------解决方案--------------------
2400:ff00::|32
应该是从
2400:ff00:0000:0000:0000:0000:0000:0000
-
2400:ff00:0000:0000:0000:0000:ffff:ffff
后面的CIDR是位数, 32位就是ffff:ffff

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Validator can be created by adding the following two lines in the controller.
