ipconv

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

Benchmark

Here is the benchmark with 2.4 GHz 8-Core Intel Core i9:

$ GOMAXPROCS=1 go test -bench='Ipconv' -benchmem -benchtime=10s 
Benchmark_Ipconv_Long2V4        433216750               27.7 ns/op            16 B/op          1 allocs/op
Benchmark_Ipconv_V42Long        652684755               18.5 ns/op             0 B/op          0 allocs/op

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Long2V4

func Long2V4(ip uint32) string

Long2V4 convert an uint32 integer to ipv4 string

func V42Long

func V42Long(ip string) (long uint32)

V42Long converts an ipv4 string to an uint32 integer. Panic if format of ip is not ipv4

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL