Skip to content

Commit e8ccfa4

Browse files
Bypass bitwise NOT
1 parent b351f64 commit e8ccfa4

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2026 IP2Location
3+
Copyright (c) 2020 - 2026 IP2Location
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

docs/source/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# -- Project information
55

66
project = 'IP2Proxy Lua'
7-
copyright = '2025, IP2Location'
7+
copyright = '2026, IP2Location'
88
author = 'IP2Location'
99

10-
release = '0.1.0'
11-
version = '0.1.0'
10+
release = '3.4.1'
11+
version = '3.4.1'
1212

1313
# -- General configuration
1414

@@ -57,4 +57,4 @@
5757

5858
html_title = "IP2Proxy Lua"
5959

60-
# html_baseurl = "https://ip2proxy-deno.readthedocs.io/en/latest/"
60+
# html_baseurl = "https://ip2proxy-lua.readthedocs.io/en/latest/"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package = "ip2proxy"
2-
version = "3.4.0-1"
2+
version = "3.4.1-1"
33
source = {
44
url = "git://github.com/ip2location/ip2proxy-lua.git"
55
}

ip2proxy.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ local threat_position = { 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12 }
9191
local provider_position = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13 }
9292
local fraudscore_position = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14 }
9393

94-
local api_version = "3.4.0"
94+
local api_version = "3.4.1"
9595

9696
local modes = {
9797
countryshort = 0x00001,
@@ -467,9 +467,8 @@ function ip2proxy:checkip(ip)
467467
ipnum = bn(ipnum2) -- convert back to bn
468468
elseif ipnum >= from_teredo and ipnum <= to_teredo then -- Teredo
469469
override = 1
470-
ipnum = ~ipnum
471-
ipnum2 = ipnum:asnumber() & 0xffffffff
472-
ipnum = bn(ipnum2) -- convert back to bn
470+
-- invert lower 32 bits only (bypass the bnot from the bn coz of weird error)
471+
ipnum = bn(0xffffffff) - (ipnum & bn(0xffffffff))
473472
end
474473

475474
local ipindex = 0

0 commit comments

Comments
 (0)