DataPadder
internal final class DataPadder
Utility class for padding and unpadding data to a specific block size.
-
Pad a
Dataobject to the specified block size.Declaration
Swift
internal static func pad(data: Data, blockSize size: Int) -> [UInt8]Parameters
dataThe
Datato be padded.sizeThe desired block size.
Return Value
Padded data as an array of
UInt8. -
Pad a byte array to the specified block size.
Declaration
Swift
internal static func pad(data: [UInt8], blockSize size: Int) -> [UInt8]Parameters
dataThe byte array to be padded.
sizeThe desired block size.
Return Value
Padded data as an array of
UInt8. -
Remove padding from a padded byte array.
Declaration
Swift
internal static func unpad(data: [UInt8]) -> [UInt8]Parameters
dataThe padded byte array.
Return Value
The original data with padding removed.
View on GitHub
DataPadder Class Reference