No description
Find a file
2020-10-28 16:38:19 +02:00
.gitignore Change name from uuid to nuuid 2015-05-13 18:02:20 -04:00
LICENSE Create LICENSE 2015-05-13 13:52:49 -04:00
nuuid.nim Fixed deprecation error 2020-10-28 16:38:19 +02:00
nuuid.nimble Update nuuid.nimble 2015-05-14 09:28:38 -04:00
README.md Update README.md 2015-05-14 11:10:49 -04:00

nim-only-uuid

A Nim source only UUID generator

A loose translation of this Javascript function (http://www.broofa.com/Tools/Math.uuid.js)

  Math.uuidCompact = function() {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
      var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
      return v.toString(16);
    });
  };

Usage:

import nuuid

echo generateUUID()

Installation

nimble install nuuid