From 3e17515e2996b79e23f569c296051a91af3fcbe4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 7 Aug 2018 15:17:17 +0200 Subject: Add torrent tests --- server/helpers/core-utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/helpers/core-utils.ts') diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts index 25eb6454a..3b38da66c 100644 --- a/server/helpers/core-utils.ts +++ b/server/helpers/core-utils.ts @@ -5,7 +5,7 @@ import * as bcrypt from 'bcrypt' import * as createTorrent from 'create-torrent' -import { pseudoRandomBytes } from 'crypto' +import { createHash, pseudoRandomBytes } from 'crypto' import { copyFile, readdir, readFile, rename, stat, Stats, unlink, writeFile } from 'fs' import * as mkdirp from 'mkdirp' import { isAbsolute, join } from 'path' @@ -13,7 +13,6 @@ import * as pem from 'pem' import * as rimraf from 'rimraf' import { URL } from 'url' import { truncate } from 'lodash' -import * as crypto from 'crypto' function sanitizeUrl (url: string) { const urlObject = new URL(url) @@ -97,7 +96,7 @@ function peertubeTruncate (str: string, maxLength: number) { } function sha256 (str: string) { - return crypto.createHash('sha256').update(str).digest('hex') + return createHash('sha256').update(str).digest('hex') } function promisify0 (func: (cb: (err: any, result: A) => void) => void): () => Promise { -- cgit v1.2.3