mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-11 00:36:26 +00:00
11 lines
245 B
JavaScript
11 lines
245 B
JavaScript
const crypto = require('crypto')
|
|
const uuidv4 = require('uuid/v4')
|
|
|
|
module.exports = function(uuid) {
|
|
if (typeof uuid === typeof true && uuid) {
|
|
return uuidv4()
|
|
}
|
|
const length = 10
|
|
return crypto.randomBytes(length).toString('hex')
|
|
}
|