Page MenuHomePhabricator

[lib] Add function to calculate padding size
ClosedPublic

Authored by bartek on Mar 28 2023, 11:01 AM.
Tags
None
Referenced Files
F1695482: D7222.diff
Fri, May 3, 6:08 AM
Unknown Object (File)
Sat, Apr 27, 8:59 PM
Unknown Object (File)
Sat, Apr 27, 8:59 PM
Unknown Object (File)
Sat, Apr 27, 8:58 PM
Unknown Object (File)
Sat, Apr 27, 8:55 PM
Unknown Object (File)
Sat, Apr 27, 8:30 PM
Unknown Object (File)
Mon, Apr 22, 2:30 AM
Unknown Object (File)
Fri, Apr 19, 11:40 PM
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