diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-11 09:52:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-11 09:52:16 +0200 |
commit | 71e318b4fe66175d03c7c82357d60062eb68af81 (patch) | |
tree | 1e6bbfa16c9aab32174ec2a87b44f357d5382f07 /server/helpers | |
parent | cc1903ad2a16adf14eaa4f5429e35c455cf93bea (diff) | |
parent | 333210d862fdba4bb114b756d4f964789f480196 (diff) | |
download | PeerTube-71e318b4fe66175d03c7c82357d60062eb68af81.tar.gz PeerTube-71e318b4fe66175d03c7c82357d60062eb68af81.tar.zst PeerTube-71e318b4fe66175d03c7c82357d60062eb68af81.zip |
Merge branch 'release/v1.0.0' into develop
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/core-utils.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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 @@ | |||
5 | 5 | ||
6 | import * as bcrypt from 'bcrypt' | 6 | import * as bcrypt from 'bcrypt' |
7 | import * as createTorrent from 'create-torrent' | 7 | import * as createTorrent from 'create-torrent' |
8 | import { createHash, pseudoRandomBytes } from 'crypto' | 8 | import { createHash, HexBase64Latin1Encoding, pseudoRandomBytes } from 'crypto' |
9 | import { isAbsolute, join } from 'path' | 9 | import { isAbsolute, join } from 'path' |
10 | import * as pem from 'pem' | 10 | import * as pem from 'pem' |
11 | import { URL } from 'url' | 11 | import { URL } from 'url' |
@@ -126,8 +126,8 @@ function peertubeTruncate (str: string, maxLength: number) { | |||
126 | return truncate(str, options) | 126 | return truncate(str, options) |
127 | } | 127 | } |
128 | 128 | ||
129 | function sha256 (str: string) { | 129 | function sha256 (str: string, encoding: HexBase64Latin1Encoding = 'hex') { |
130 | return createHash('sha256').update(str).digest('hex') | 130 | return createHash('sha256').update(str).digest(encoding) |
131 | } | 131 | } |
132 | 132 | ||
133 | function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> { | 133 | function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> { |