gnablib-go

module
v0.0.0-...-68fec7b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MPL-2.0

README

gnabglib-go

Basic tools for any app

Checksum
CodeGen
  • BytesToHexSep: Format a byte slice in rows of bytesPerSection values, formatted in hexadecimal format
  • BytesToString: Format a byte slice as a utf8 string, useful for constants in go
  • BytesToStringSep: Format a byte slice in rows of bytesPerSection UTF8 strings
Encoding
  • hex: Convert byte slices to/from hex strings. Includes a tag:tiny version that doesn't use a 256 byte lookup table for use on embedded devices (~50% slower than regular). Similar to go's built-in hex encoded, except errors include location and value of invalid hex-values on decode.
Endian
  • Detect platform endianness
Hash
Net
  • CIDR, IPv4, Mask types
  • IpTree: Add CIDR and IP addresses to a collection and get back the shortest description of the composition (repeat/overlapping CIDR will merge, sequential CIDR will join into larger sets). Useful for eg firewall rules

Testing

go test ./...

Directories

Path Synopsis
bcc
lrc
encoding
hex
This packages maps gnablib terms to go (to speed up dev) and adheres to https://datatracker.ietf.org/doc/html/rfc4648#section-8 which says HEX is case-insensitive, but uses upper case letters in all examples no need extra features
This packages maps gnablib terms to go (to speed up dev) and adheres to https://datatracker.ietf.org/doc/html/rfc4648#section-8 which says HEX is case-insensitive, but uses upper case letters in all examples no need extra features
hash

Jump to

Keyboard shortcuts

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