ahawker / ulid

Universally Unique Lexicographically Sortable Identifier (ULID) in Python 3
Apache License 2.0
705 stars 42 forks source link

How to derive a ULID from a string? #483

Closed jamesshapiro closed 3 years ago

jamesshapiro commented 3 years ago

Suppose you have

ulid_string = '01EYV88PB2Y212QSR0AJ2JX5T4'

How would you derive a ulid object from the string?

jamesshapiro commented 3 years ago

Nvmd, figured it out:

parsed_ulid = ulid.parse(ulid_string)

ahawker commented 3 years ago

ulid.from_str will be slightly more performant as parse attempts to handle all supported types/formats.