@MarcusWeinberger/

extract-from-uuid1

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import uuid, time, datetime

_uid = input('enter uuid or leave blank to generate: ') or str(uuid.uuid1())
print("Getting info from uuid:",_uid)

uid = uuid.UUID(_uid) # import uuid from string

if not uid.version == 1:
    print("UUID is not version 1! All data is random.")

date = datetime.datetime.fromtimestamp((uid.time - 0x01b21dd213814000) * 100/1e9) # https://stackoverflow.com/a/3795750/8291579
mac = ':'.join(("%012X" % uid.node)[i:i+2] for i in range(0, 12, 2)).lower()

print('This uuid was genrated at:',str(date))
print('The computer that generated it has a MAC address of:',mac)