a random 12-digit mac address generator
Project description
randmac.py
a utility that generates 12-digit mac addresses; either the NIC portion or full 12-digit MAC.
the optional -f
argument will return a random 12-digit MAC address that can be identified by the locally administrated address (LAA) format. This means you will always see x2
, x6
, xA
, or xE
at the beginning of a MAC address generated by randmac.
installation
to install with pip:
pip install randmac
requirements
Python >3.2 required.
mac address formats
Supported MAC address formats:
- MM:MM:MM:SS:SS:SS
- MM-MM-MM-SS-SS-SS
- MM.MM.MM.SS.SS.SS
- MMMM.MMSS.SSSS
- MMMMMMSSSSSS
where M
stands for the manufacturer or vendor, and S
stands for the NIC specific portion.
usage
requires a mac address as input. it is used to determine what the output format should be.
you can from randmac import RandMac
and use it like RandMac("00:00:00:00:00:00")
.
from a terminal (if the randmac.py is in your path and executable) you can use $ python3 randmac.py 00:00:00:00:00:00
to get a generate a new NIC portion, or $ python3 randmac.py 00:00:00:00:00:00 -f
to generate a new 12-digit LAA MAC.
example usage
>>> from randmac import RandMac
>>> RandMac("00:00:00:00:00:00")
'00:00:00:00:fd:9e'
>>> RandMac("00:00:00:00:00:00", True)
'ba:ac:5f:09:fc:bb'
>>> RandMac("0000.0000.0000", True)
'fe84.857f.900f'
or
$ python3 randmac.py 00:00:00:00:00:00
00:00:00:fc:e1:5b
$ python3 randmac.py 00:00:00:00:00:00 -f
2a:81:b0:e7:1d:08
license
license can be found here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for randmac-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 468c43ca43ada51719c34fab7afa3cbc5df01fddce370b947b4ec55a3448644c |
|
MD5 | e71c0fba7f6440f081f3606da5219d6f |
|
BLAKE2b-256 | ebd6c17f9a1c76eb12228e7c4462fdec9010be69834a11895eeb9fd560854d7f |