Giter Club home page Giter Club logo

formac's Introduction

formac

formac formats MAC addresses into different common formats.

Install with go get github.com/hslabbert/formac...

MAC addresses are parsed using net.ParseMAC(), so any MAC address format supported by net.ParseMAC() is accepted by formac.

Output can be either plain or json, with the default being plain.

Outputted formats are:

  • Cisco: Cisco format; three sets of 2 hex bytes separated by periods.
  • UnixExpanded: What we commonly expect; hex bytes separated by colons.
  • UnixCompact: Same as Unix, except duplicate zeroes removed.
  • EUI: Dash-separated hex bytes, upper case.
  • Bare: No separators, upper case.
  • PgSQL: Two sets of 3 hex bytes, separated by a colon.

Also, will output the manufacturer ("OUI") for the MAC if found. Manufacturer lookups are from IEEE registries.

Usage

Basic usage:

$ formac -h
Usage of formac:
  -format string
        MAC output format (default "plain")
  string
        The MAC address to parse and format

Default to plain output:

$ formac 00-00-5E-00-53-01
Cisco: 0000.5e00.5301
UnixExpanded: 00:00:5e:00:53:01
UnixCompact: 0:0:5e:0:53:1
EUI: 00-00-5E-00-53-01
Bare: 00005E005301
PgSQL: 00005e:005301
Manufacturer: ICANN, IANA Department

Or as json:

$ formac -format json 0000.5e00.5301
{"Cisco":"0000.5e00.5301","UnixExpanded":"00:00:5e:00:53:01","UnixCompact":"0:0:5e:0:53:1","EUI":"00-00-5E-00-53-01","Bare":"00005E005301","PgSQL":"00005e:005301","Manufacturer":"IC
ANN, IANA Department"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.