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)
Tue, Apr 16, 9:15 AM
Unknown Object (File)
Sun, Apr 14, 9:47 PM
Unknown Object (File)
Wed, Apr 10, 7:26 PM
Unknown Object (File)
Mon, Apr 8, 4:12 PM
Unknown Object (File)
Thu, Mar 28, 7:37 AM
Unknown Object (File)
Thu, Mar 28, 7:37 AM
Unknown Object (File)
Thu, Mar 28, 7:37 AM
Unknown Object (File)
Thu, Mar 28, 7:36 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