From 729bb184819ddda1d7313da0c30b3397e5689721 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 Oct 2018 08:51:58 +0200 Subject: Add more headers to broadcast/unicast --- server/helpers/core-utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/helpers') diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts index 00bc0bdda..224e4fe92 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 { createHash, pseudoRandomBytes } from 'crypto' +import { createHash, HexBase64Latin1Encoding, pseudoRandomBytes } from 'crypto' import { isAbsolute, join } from 'path' import * as pem from 'pem' import { URL } from 'url' @@ -126,8 +126,8 @@ function peertubeTruncate (str: string, maxLength: number) { return truncate(str, options) } -function sha256 (str: string) { - return createHash('sha256').update(str).digest('hex') +function sha256 (str: string, encoding: HexBase64Latin1Encoding = 'hex') { + return createHash('sha256').update(str).digest(encoding) } function promisify0 (func: (cb: (err: any, result: A) => void) => void): () => Promise { -- cgit v1.2.3