UUID library for Nim
Find a file
2016-09-16 12:41:51 +07:00
.vscode First version 2016-09-15 20:35:01 +07:00
src Fixed setting unnecessary bit 2016-09-16 12:41:51 +07:00
.gitignore First version 2016-09-15 20:35:01 +07:00
LICENSE First version 2016-09-15 20:35:01 +07:00
README.md Use ISAAC 2016-09-16 01:36:19 +07:00
uuids.nimble Use ISAAC 2016-09-16 01:36:19 +07:00

uuids

UUID library for Nim.

API:

type UUID* = object
  ## 128-bit UUID compliant with RFC-4122

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 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.