uuids
UUID library for Nim
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:24 |
Tags
Installation
nimble install uuids
choosenim install uuids
git clone https://github.com/pragmagic/uuids/
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| uuids | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/pragmagic/uuids/ |
|---|---|
| Homepage | https://github.com/pragmagic/uuids/ |
| Registry Source | nimble_official |
README
uuids
UUID library for Nim.
API:
type UUID* = object
## 128-bit UUID compliant with RFC-4122
proc initUUID*(mostSigBits, leastSigBits: int64): UUID =
## Initializes UUID with the specified most and least significant bits
proc 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 file for details.
Copyright (c) 2016 Xored Software, Inc.