actions icon indicating copy to clipboard operation
actions copied to clipboard

Refactor: replace deprecated 'binary' encoding with Buffer

Open c3retc3 opened this issue 10 months ago • 2 comments

As per the Node.js documentation, 'binary' encoding is outdated and can lead to unexpected behavior or data loss.

  1. Replaced deprecated 'binary' string encoding with direct Buffer operations for data key handling.
  2. The encrypt method now passes the dataKey buffer directly to crypto.update.
  3. The decrypt method now correctly reconstructs the dataKey using Buffer.concat.

This improves code quality and future compatibility without altering the cryptographic logic.

c3retc3 avatar Jun 04 '25 08:06 c3retc3

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jun 04 '25 08:06 google-cla[bot]

Hello everyone, could someone please take a look at this PR on deprecated 'binary' string encoding, or point me to the right reviewer?

c3retc3 avatar Jun 08 '25 01:06 c3retc3