Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipv4 地址转换,为何不使用inet_ntop() 函数 #13

Open
twomiao opened this issue Jan 10, 2022 · 1 comment
Open

ipv4 地址转换,为何不使用inet_ntop() 函数 #13

twomiao opened this issue Jan 10, 2022 · 1 comment

Comments

@twomiao
Copy link

twomiao commented Jan 10, 2022

Socks5 源码:
for ($i = 0; $i < 4; $i++) { // var_dump(ord($tmp[$i])); $ip += ord($tmp[$i]) * pow(256, 3 - $i); } $request['dest_addr'] = long2ip($ip);

使用内置函数也可以解析:
inet_ntop()

@walkor
Copy link
Owner

walkor commented Jan 10, 2022

这段是合并进来的代码,如果你觉得哪里可以优化,可以发pr哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants