aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/core-utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-03 09:33:05 +0100
committerChocobozzz <me@florianbigard.com>2021-02-03 09:45:08 +0100
commitba5a8d89bbf049e4afc41543bcc072cccdb02669 (patch)
tree6cc6b2dca17745cc0824c7ad4515f3bc4883fa4a /server/helpers/core-utils.ts
parent29f148a61381727a432c22a71c7a2b7cc23d9c9e (diff)
downloadPeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.gz
PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.zst
PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.zip
Update server dependencies
Diffstat (limited to 'server/helpers/core-utils.ts')
-rw-r--r--server/helpers/core-utils.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts
index e1c15a6eb..935fd22d9 100644
--- a/server/helpers/core-utils.ts
+++ b/server/helpers/core-utils.ts
@@ -5,12 +5,12 @@
5 Useful to avoid circular dependencies. 5 Useful to avoid circular dependencies.
6*/ 6*/
7 7
8import { createHash, HexBase64Latin1Encoding, randomBytes } from 'crypto' 8import { exec, ExecOptions } from 'child_process'
9import { BinaryToTextEncoding, createHash, randomBytes } from 'crypto'
10import { truncate } from 'lodash'
9import { basename, isAbsolute, join, resolve } from 'path' 11import { basename, isAbsolute, join, resolve } from 'path'
10import * as pem from 'pem' 12import * as pem from 'pem'
11import { URL } from 'url' 13import { URL } from 'url'
12import { truncate } from 'lodash'
13import { exec, ExecOptions } from 'child_process'
14 14
15const objectConverter = (oldObject: any, keyConverter: (e: string) => string, valueConverter: (e: any) => any) => { 15const objectConverter = (oldObject: any, keyConverter: (e: string) => string, valueConverter: (e: any) => any) => {
16 if (!oldObject || typeof oldObject !== 'object') { 16 if (!oldObject || typeof oldObject !== 'object') {
@@ -205,11 +205,11 @@ function peertubeTruncate (str: string, options: { length: number, separator?: R
205 return truncate(str, options) 205 return truncate(str, options)
206} 206}
207 207
208function sha256 (str: string | Buffer, encoding: HexBase64Latin1Encoding = 'hex') { 208function sha256 (str: string | Buffer, encoding: BinaryToTextEncoding = 'hex') {
209 return createHash('sha256').update(str).digest(encoding) 209 return createHash('sha256').update(str).digest(encoding)
210} 210}
211 211
212function sha1 (str: string | Buffer, encoding: HexBase64Latin1Encoding = 'hex') { 212function sha1 (str: string | Buffer, encoding: BinaryToTextEncoding = 'hex') {
213 return createHash('sha1').update(str).digest(encoding) 213 return createHash('sha1').update(str).digest(encoding)
214} 214}
215 215