aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-10 21:19:24 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-10 21:19:24 +0200
commitcbe2f7c34822b1bd3b1f8c691f79f0c29cf21f07 (patch)
treece678124210db8b03b2a523e3b92a14cc403eeee /server/helpers
parentf1dae018681936b556b2496b7f2d872c004cfda3 (diff)
downloadPeerTube-cbe2f7c34822b1bd3b1f8c691f79f0c29cf21f07.tar.gz
PeerTube-cbe2f7c34822b1bd3b1f8c691f79f0c29cf21f07.tar.zst
PeerTube-cbe2f7c34822b1bd3b1f8c691f79f0c29cf21f07.zip
Refractoring and add thumbnails support (without tests)
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/utils.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/helpers/utils.js b/server/helpers/utils.js
index 1f7839673..9d4d51c46 100644
--- a/server/helpers/utils.js
+++ b/server/helpers/utils.js
@@ -1,9 +1,20 @@
1'use strict' 1'use strict'
2 2
3const crypto = require('crypto')
4
3const logger = require('./logger') 5const logger = require('./logger')
4 6
5const utils = { 7const utils = {
6 cleanForExit: cleanForExit 8 cleanForExit: cleanForExit,
9 generateRandomString: generateRandomString
10}
11
12function generateRandomString (size, callback) {
13 crypto.pseudoRandomBytes(size, function (err, raw) {
14 if (err) return callback(err)
15
16 callback(null, raw.toString('hex'))
17 })
7} 18}
8 19
9function cleanForExit (webtorrent_process) { 20function cleanForExit (webtorrent_process) {