Skip to content

oceanborn2/nim-only-uuid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Nim UUID generator - Nim source only library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nim 100.0%