node-ldapjs/test/utils.js

23 lines
367 B
JavaScript
Raw Permalink Normal View History

'use strict'
const os = require('os')
const path = require('path')
2020-07-22 15:11:48 +00:00
const crypto = require('crypto')
function uuid () {
return crypto.randomBytes(16).toString('hex')
}
function getSock () {
if (process.platform === 'win32') {
return '\\\\.\\pipe\\' + uuid()
} else {
return path.join(os.tmpdir(), uuid())
}
}
module.exports = {
2020-07-22 15:11:48 +00:00
getSock,
uuid
}