Skip to content

WIP: Add uuid module#504

Open
mattytrentini wants to merge 2 commits into
micropython:masterfrom
mattytrentini:add-uuid
Open

WIP: Add uuid module#504
mattytrentini wants to merge 2 commits into
micropython:masterfrom
mattytrentini:add-uuid

Conversation

@mattytrentini

Copy link
Copy Markdown
Contributor

Basic functionality (notably, all of the uuidX() methods) of most of the uuid module appears to work, or at least generate reasonable-looking results.

This started as a copy of the CPython code (see README) and then some functionality was trimmed or modified in order to execute under MicroPython.

Still to-do:

  • Update tests to pass
  • Extend README.md - how to execute, which functionality is supported etc
  • Remove large docstrings

# 0x01b21dd213814000 is the number of 100-ns intervals between the
# UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
# TODO mst This timestamp will need to be adjusted (MicroPython Epoch is different)
timestamp = nanoseconds // 100 + 0x01b21dd213814000

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe try using time.gmtime(0) to find the Epoch

@dpgeorge

Copy link
Copy Markdown
Member

I propose we close this in favour of #1137.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants