diff --git a/classes.php b/classes.php index a09ab8a..1c2312c 100644 --- a/classes.php +++ b/classes.php @@ -53,6 +53,36 @@ class ActionQuotedPrintableDecode extends AbstractAction } } +class ActionBase64Encode extends AbstractAction +{ + public function __construct( $value ) + { + parent::__construct( $value ); + $this->setContainer( new TextareaContainer ); + $this->setFormatter( new EchoFormatter ); + } + + public function decode() + { + return base64_encode( $this->value ); + } +} + +class ActionBase64Decode extends AbstractAction +{ + public function __construct( $value ) + { + parent::__construct( $value ); + $this->setContainer( new TextareaContainer ); + $this->setFormatter( new EchoFormatter ); + } + + public function decode() + { + return base64_decode( $this->value ); + } +} + class ActionUrldecode extends AbstractAction { public function __construct( $value ) diff --git a/index.php b/index.php index b6c0aac..402f144 100644 --- a/index.php +++ b/index.php @@ -37,6 +37,8 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) { + + @@ -44,5 +46,12 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) { +

Randomness

+ + + diff --git a/style.css b/style.css index 2402457..434ab2e 100644 --- a/style.css +++ b/style.css @@ -22,3 +22,7 @@ h2 { float: left; padding: 10px; } + +.randomness-box { + width: 30em; +}