mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2025-12-08 19:25:22 +00:00
49 lines
810 B
JavaScript
49 lines
810 B
JavaScript
// Copyright 2022 The Ip2Region Authors. All rights reserved.
|
|
// Use of this source code is governed by a Apache2.0-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// util functions
|
|
// @Author Lion <chenxin619315@gmail.com>
|
|
|
|
// parse the specified string ip and return its bytes
|
|
// @param ip string
|
|
// @return Buffer
|
|
function parseIP(ipString) {
|
|
}
|
|
|
|
|
|
// bytes ip to humen-readable string ip
|
|
function ipToString(ipBytes) {
|
|
|
|
}
|
|
|
|
// compare two byte ips
|
|
// returns: -1 if ip1 < ip2, 1 if ip1 > ip2 or 0
|
|
function ipCompare(ip1, ip2) {
|
|
|
|
}
|
|
|
|
// load header from xdb file
|
|
function loadHeader(handle) {
|
|
|
|
}
|
|
|
|
function loadHeaderFromFile(dbPath) {
|
|
|
|
}
|
|
|
|
function loadVectorIndex(handle) {
|
|
|
|
}
|
|
|
|
function loadVectorIndexFromFile(dbPath) {
|
|
|
|
}
|
|
|
|
function loadContent(handle) {
|
|
|
|
}
|
|
|
|
function loadContentFromFile(dbPath) {
|
|
|
|
} |