Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pragmagic/uuids
UUID library for Nim
https://github.com/pragmagic/uuids
nim uuid
Last synced: 4 days ago
JSON representation
UUID library for Nim
- Host: GitHub
- URL: https://github.com/pragmagic/uuids
- Owner: pragmagic
- License: other
- Created: 2016-09-15T13:35:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:24:03.000Z (about 1 year ago)
- Last Synced: 2024-12-04T17:11:39.437Z (2 months ago)
- Topics: nim, uuid
- Language: Nim
- Size: 13.7 KB
- Stars: 38
- Watchers: 7
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uuids
UUID library for Nim.
API:
```nim
type UUID* = object
## 128-bit UUID compliant with RFC-4122proc initUUID*(mostSigBits, leastSigBits: int64): UUID =
## Initializes UUID with the specified most and least significant bitsproc leastSigBits*(uuid: UUID): int64 {.inline.}
## Returns 64 least significant bits of the ``uuid``proc mostSigBits*(uuid: UUID): int64 {.inline.}
## Returns 64 most significant bits of the ``uuid``proc `$`*(uuid: UUID): string
## Returns a string representation of the ``uuid`` in canonical form.proc hash*(uuid: UUID): Hash
## Computes hash of the specified ``uuid``.proc `==`*(x, y: UUID): bool
## Returns true when the specified UUIDs are equal, false otherwise.proc isZero*(uuid: UUID): bool
## Returns ``true`` when the ``uuid`` is zero (not set), ``false`` otherwise.proc genUUID*(): UUID
## Returns a random (v4) UUID.
## Uses a thread-local cryptographically secure PRNG (ISAAC) seeded with
## true random values obtained from OS.proc parseUUID*(s: string): UUID {.raises: [ValueError].}
## Converts string representation of an UUID to UUID object.
## Raises ValueError if invalid format is provided.
```## License
This library is licensed under the MIT license.
Read [LICENSE](https://github.com/pragmagic/uuids/blob/master/LICENSE) file for details.Copyright (c) 2016 Xored Software, Inc.