- Notifications
You must be signed in to change notification settings - Fork13
A blazing-fast, thread-safe, straightforward and zero memory allocations tool to swiftly generate alternative IP(v4) address representations in Go.
License
NotificationsYou must be signed in to change notification settings
dwisiswant0/ipfuscator
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ipfuscator is ablazing-fast, thread-safe, straightforward and zero memory allocations tool to swiftly generate alternative IP(v4) address representations through conversion and manipulation techniques.
with Binary
Just grab the bin based on your arch fromrelease page.
with Go
NoteInstallation ofGo version 1.16 or newer is required.
go install github.com/dwisiswant0/ipfuscator@latest
go get github.com/dwisiswant0/ipfuscator/pkg/ipfuscator@latest
ipfuscator 1.0.0 by @dwisiswant0 -- A blazing-fast, thread-safe, straightforward and zero memory allocations tool to swiftly generate alternative IP(v4) address representations in Go.Usage ipfuscator [OPTIONS] --method [METHOD] [ADDR]Options: -m, --method <METHOD> Specify the glob conversion method to use (default: "*") -l, --list Display a list of available conversion methodsExamples: ipfuscator -l ipfuscator 127.0.0.1 ipfuscator -m "To*" 127.0.0.1 ipfuscator -m "*Padding" 127.0.0.1 ipfuscator -m "ToHexWithPadding" 127.0.0.1
See thedocs.
Examples
package mainimport ("fmt""net""github.com/dwisiswant0/ipfuscator/pkg/ipfuscator")funcmain() {ipv4:=net.ParseIP("127.0.0.1")ipf,err:=ipfuscator.New(ipv4)iferr!=nil {panic(err)}fmt.Printf("Base w/ Padding:\t%s\n",ipf.ToBaseWithPadding())fmt.Printf("Circled digits:\t%s\n",ipf.ToCircledDigits())fmt.Printf("Decimal:\t\t%s\n",ipf.ToDecimal())fmt.Printf("Hex w/ Padding:\t%s\n",ipf.ToHexWithPadding())fmt.Printf("Hex:\t\t\t%s\n",ipf.ToHex())fmt.Printf("IPv6 Embedded:\t\t%s\n",ipf.ToIPv6CompatibleV4())fmt.Printf("No zeros:\t\t%s\n",ipf.ToNoZeros())fmt.Printf("Octal w/ Padding:\t%s\n",ipf.ToOctalWithPadding())fmt.Printf("Octal:\t\t\t%s\n",ipf.ToOctal())fmt.Printf("Rand 8-bits:\t\t%s\n",ipf.ToRand8Bits())fmt.Printf("Rand w/ Padding:\t%s\n",ipf.ToRandBaseWithPadding())fmt.Printf("Rand:\t\t\t%s\n",ipf.ToRandBase())// Output:// Base w/ Padding: 127.00000000000000.000000000.1// Circled digits: ①②⑦.⓪.⓪.①// Decimal: 2130706433// Hex w/ Padding: 0x0000000000007f.0x0000000000000000000000.0x0000000000000000000000.0x0000000001// Hex: 0x7f.0x0.0x0.0x1// IPv6 Embedded: [::ffff:127.0.0.1]// No zeros: 127.1// Octal w/ Padding: 00000000000177.000000.0000000000000000.0000000000000000001// Octal: 0177.0.0.1// Rand 8-bits: 127.0.0.119// Rand w/ Padding: 0x000000000000000000000007f.0x00000000000000000000000000.0x0000000.0x01// Rand: 0x7f.0x0.0x0.0x1}
$make benchgoos: linuxgoarch: amd64pkg: github.com/dwisiswant0/ipfuscator/pkg/ipfuscatorcpu: 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHzBenchmarkToBaseWithPadding-16 6483795 178.3 ns/opBenchmarkToCircledDigits-16 8223832 142.3 ns/opBenchmarkToDecimal-16 43212138 26.25 ns/opBenchmarkToHex-16 31927065 40.15 ns/opBenchmarkToHexWithPadding-16 1927899 635.0 ns/opBenchmarkToIPv6CompatibleV4-16 16217696 72.04 ns/opBenchmarkToNoZeros-16 26995516 45.83 ns/opBenchmarkToOctal-16 22103026 55.83 ns/opBenchmarkToOctalWithPadding-16 3390346 359.3 ns/opBenchmarkToRand8Bits-16 16113920 75.93 ns/opBenchmarkToRandBase-16 9400024 128.6 ns/opBenchmarkToRandBaseWithPadding-16 2534938 472.0 ns/opPASSok github.com/dwisiswant0/ipfuscator/pkg/ipfuscator16.722s
ipfuscator is released underApache-2.0. Copyright (c) 2023 Dwi Siswanto.
About
A blazing-fast, thread-safe, straightforward and zero memory allocations tool to swiftly generate alternative IP(v4) address representations in Go.