Skip to content

gnabgib/gnablib-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ./...

About

Basic tools for any app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages