Page MenuHomePhabricator

[lib] Add function to calculate padding size
ClosedPublic

Authored by bartek on Mar 28 2023, 11:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 8:35 AM
Unknown Object (File)
Thu, Nov 7, 10:49 AM
Unknown Object (File)
Wed, Nov 6, 3:22 AM
Unknown Object (File)
Wed, Nov 6, 3:22 AM
Unknown Object (File)
Wed, Nov 6, 3:22 AM
Unknown Object (File)
Mon, Nov 4, 12:07 PM
Unknown Object (File)
Sun, Oct 27, 1:59 AM
Unknown Object (File)
Sun, Oct 27, 1:59 AM
Subscribers

Details

Summary

This diff adds a function to calculate file size after padding. It will be used in subsequent diffs.
The content is basically copied from actual padding functions.

Test Plan

Added unit test

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Mar 28 2023, 11:35 AM

Thanks for including a test (and adding a comment explaining what's happening)

lib/utils/pkcs7-padding.js
41–45 ↗(On Diff #24298)

I think usually we'd do something like this, but don't feel too strongly.

(cc @ashoat)

This revision is now accepted and ready to land.Mar 28 2023, 3:54 PM
lib/utils/pkcs7-padding.js
41–45 ↗(On Diff #24298)

I'm okay either way. Agree that @bartek's usage is more rare, but it's not too unclear