regex - Increase / Decrease Mac Address in Python from String -


i have mac address in string form. interested in taking mac string , increasing / decreasing 1 value while keeping integrity of hex in python

ex: 000000001f

-1: 000000001e +1: 0000000020

parse it, change it, print it!

def change_mac(mac, offset)     return "{:012x}".format(int(mac, 16) + offset) 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -