rangoo94/easen-tools

View on GitHub
packages/uuid/src/node/generateUuid.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
const convertBinaryUuidToString = require('../shared/convertBinaryUuidToString')
const generateBinaryUuid = require('./generateBinaryUuid')

/**
 * Generate string representation of UUID v4,
 * using 'crypto' with Node-compatible API.
 *
 * @returns {string}
 */
function generateUuid () {
  return convertBinaryUuidToString(generateBinaryUuid())
}

module.exports = generateUuid