Skip to content

Commit bfaa637

Browse files
committed
refactor: simplify encryption transformation in network facade service
1 parent 512d6c0 commit bfaa637

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/services/network/network-facade.service.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,11 @@ export class NetworkFacade {
148148
};
149149

150150
const encryptFile: EncryptFileFunction = async (_, key, iv) => {
151-
encryptionTransform = from
152-
.pipe(
153-
await this.cryptoService.getEncryptionTransform(
154-
Buffer.from(key as ArrayBuffer),
155-
Buffer.from(iv as ArrayBuffer),
156-
),
157-
)
158-
.pipe(hashStream);
151+
const encryptionCipher = this.cryptoService.getEncryptionTransform(
152+
Buffer.from(key as ArrayBuffer),
153+
Buffer.from(iv as ArrayBuffer),
154+
);
155+
encryptionTransform = from.pipe(encryptionCipher).pipe(hashStream);
159156
};
160157

161158
const uploadFile: UploadFileFunction = async (url) => {

0 commit comments

Comments
 (0)