diff options
Diffstat (limited to 'server/helpers/core-utils.ts')
-rw-r--r-- | server/helpers/core-utils.ts | 10 |
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 | ||
8 | import { createHash, HexBase64Latin1Encoding, randomBytes } from 'crypto' | 8 | import { exec, ExecOptions } from 'child_process' |
9 | import { BinaryToTextEncoding, createHash, randomBytes } from 'crypto' | ||
10 | import { truncate } from 'lodash' | ||
9 | import { basename, isAbsolute, join, resolve } from 'path' | 11 | import { basename, isAbsolute, join, resolve } from 'path' |
10 | import * as pem from 'pem' | 12 | import * as pem from 'pem' |
11 | import { URL } from 'url' | 13 | import { URL } from 'url' |
12 | import { truncate } from 'lodash' | ||
13 | import { exec, ExecOptions } from 'child_process' | ||
14 | 14 | ||
15 | const objectConverter = (oldObject: any, keyConverter: (e: string) => string, valueConverter: (e: any) => any) => { | 15 | const 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 | ||
208 | function sha256 (str: string | Buffer, encoding: HexBase64Latin1Encoding = 'hex') { | 208 | function 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 | ||
212 | function sha1 (str: string | Buffer, encoding: HexBase64Latin1Encoding = 'hex') { | 212 | function 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 | ||