!508 change ipv4util getBeginIpLong to public

Merge pull request !508 from 不忘初心/v5-dev
This commit is contained in:
Looly 2022-01-20 02:38:19 +00:00 committed by Gitee
commit cbc6682a5c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -187,7 +187,7 @@ public class Ipv4Util {
* @param maskBit 给定的掩码位如30
* @return 起始IP的长整型表示
*/
private static Long getBeginIpLong(String ip, int maskBit) {
public static Long getBeginIpLong(String ip, int maskBit) {
return ipv4ToLong(ip) & ipv4ToLong(getMaskByMaskBit(maskBit));
}
@ -348,7 +348,7 @@ public class Ipv4Util {
* @param maskBit 给定的掩码位如30
* @return 终止IP的长整型表示
*/
private static Long getEndIpLong(String ip, int maskBit) {
public static Long getEndIpLong(String ip, int maskBit) {
return getBeginIpLong(ip, maskBit)
+ ~ipv4ToLong(getMaskByMaskBit(maskBit));
}