ken_nogi/NodeJS/LDAP/node_modules/ldapjs/test/utils.js
Kenichiro NOGI 51a95c5e21 NodeJS
2025-07-10 10:12:37 +09:00

23 lines
367 B
JavaScript

'use strict'
const os = require('os')
const path = require('path')
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 = {
getSock,
uuid
}