Commit | Line | Data |
---|---|---|
14d4f286 S |
1 | <?php |
2 | /** | |
3 | * The core PackingMode interface. All packingmodes must implement this | |
4 | * interface | |
5 | * | |
6 | * A packing mode is a method for padding a string to a specified size using | |
7 | * various methods | |
8 | * | |
9 | * PHP version 5.3 | |
10 | * | |
11 | * @category PHPCryptLib | |
12 | * @package Encryption | |
13 | * @author Anthony Ferrara <ircmaxell@ircmaxell.com> | |
14 | * @copyright 2011 The Authors | |
15 | * @license http://www.opensource.org/licenses/mit-license.html MIT License | |
16 | * @version Build @@version@@ | |
17 | */ | |
18 | ||
19 | namespace CryptLib\Encryption; | |
20 | ||
21 | /** | |
22 | * The core PackingMode interface. All packingmodes must implement this | |
23 | * interface | |
24 | * | |
25 | * A packing mode is a method for padding a string to a specified size using | |
26 | * various methods | |
27 | * | |
28 | * @category PHPCryptLib | |
29 | * @package Encryption | |
30 | * @author Anthony Ferrara <ircmaxell@ircmaxell.com> | |
31 | * @codeCoverageIgnore | |
32 | */ | |
33 | interface PackingMode { | |
34 | ||
35 | /** | |
36 | * Pad the string to the specified size | |
37 | * | |
38 | * @param string $string The string to pad | |
39 | * @param int $blockSize The size to pad to | |
40 | * | |
41 | * @return string The padded string | |
42 | */ | |
43 | public function pad($string, $blockSize = 32); | |
44 | ||
45 | /** | |
46 | * Strip the padding from the supplied string | |
47 | * | |
48 | * @param string $string The string to trim | |
49 | * | |
50 | * @return string The unpadded string | |
51 | */ | |
52 | public function strip($string); | |
53 | ||
54 | } | |
55 |