use TransformStream if available

This commit is contained in:
Danny Coates 2018-07-19 14:46:12 -07:00
parent f32ebd913a
commit 38fd349d9b
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
3 changed files with 13 additions and 7 deletions

View file

@ -1,5 +1,5 @@
import 'buffer';
import { transform } from './streams';
import { transformStream } from './streams';
const NONCE_LENGTH = 12;
const TAG_LENGTH = 16;
@ -353,9 +353,12 @@ export default class ECE {
new BlobSlicer(this.input, this.rs, this.mode)
);
} else {
inputStream = transform(this.input, new StreamSlicer(this.rs, this.mode));
inputStream = transformStream(
this.input,
new StreamSlicer(this.rs, this.mode)
);
}
return transform(
return transformStream(
inputStream,
new ECETransformer(this.mode, this.key, this.rs, this.salt)
);