pip_services3_commons.data.IdGenerator module
pip_services3_commons.data.IdGenerator
ID generator implementation.
- copyright
Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
- license
MIT, see LICENSE for more details.
-
class
pip_services3_commons.data.IdGenerator.
IdGenerator
Bases:
object
Helper class to generate unique object IDs. It supports two types of IDs: long and short.
Long IDs are string GUIDs. They are globally unique and 32-character long. ShortIDs are just 9-digit random numbers. They are not guaranteed be unique.
Example:
IdGenerator.next_long() # Possible result: "234ab342c56a2b49c2ab42bf23ff991ac" IdGenerator.next_short() # Possible result: "23495247"