• Stars
    star
    293
  • Rank 141,748 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created over 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fastest IP To Country Library

iploc - fastest ip country library

godoc release goreport coverage

Getting Started

try on https://play.golang.org/p/T_7jfSr0cE1

package main

import (
	"fmt"
	"net"
	"github.com/phuslu/iploc"
)

func main() {
	fmt.Printf("%s", iploc.Country(net.IP{1,1,1,1}))
}

// Output: US

Benchmarks

BenchmarkCountryForIPv4-2   	52205133	        22.84 ns/op	       0 B/op	       0 allocs/op
BenchmarkCountryForIPv6-2   	32255604	        31.92 ns/op	       0 B/op	       0 allocs/op

Acknowledgment

This site or product includes IP2Location LITE data available from http://www.ip2location.com.

How often are the inlined ip data updated?

Following IP2Location Lite Database, usually monthly.