Fixed Buffer.concat error when using symmetric encryption in the browser

This commit is contained in:
Franck Royer 2021-08-26 15:22:42 +10:00
parent 489fc5af08
commit 398f34b57f
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- **Breaking**: Moved `startTime` and `endTime` for history queries to a `timeFilter` property as both or neither must be passed; passing only one parameter is not supported.
### Fixed
- Buffer concat error when using symmetric encryption in the browser.
## [0.11.0] - 2021-08-20
### Added

View File

@ -147,7 +147,7 @@ export async function encryptSymmetric(
// Returns `cipher | tag`
const cipher = await symmetric.encrypt(iv, hexToBuf(key), Buffer.from(data));
return Buffer.concat([cipher, iv]);
return Buffer.concat([cipher, Buffer.from(iv)]);
}
/**