提交 bb87ed88 编写于 作者: B Benjamin Pasero

fix strict null

上级 fb493550
......@@ -23,10 +23,8 @@ export class HashService implements IHashService {
createSHA1(content: string): Thenable<string> {
return crypto.subtle.digest('SHA-1', new TextEncoder().encode(content)).then(buffer => {
const byteArray = new Uint8Array(buffer);
// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#Converting_a_digest_to_a_hex_string
return [...byteArray].map(value => (`00${value.toString(16)}`).slice(-2)).join('');
return Array.prototype.map.call(new Uint8Array(buffer), value => `00${value.toString(16)}`.slice(-2)).join('');
});
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册