aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/core-utils.ts
diff options
context:
space:
mode:
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