Skip to content

o6web/MultiEncoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultiEncoder

Package for managing multi-step encoding and decoding of strings/objects.

Usage

use o6web\MultiEncoder\Encoder;
use o6web\MultiEncoder\Step;

// Define the encoding steps
$encode = [
    // Steps can be existing functions or callable
	new Step('strrev'),
	new Step('base64_encode'),
];

// Define the decoding steps
$decode = [
	new Step('base64_decode'),
	new Step('strrev'),
];

$multiEncoder = new Translator($encode, $decode);

$data = 'This is a string';

$encoded_data = $multiEncoder->encode($data); // Z25pcnRzIGEgc2kgc2loVA==

$decoded_data = $multiEncoder->decode($encoded_data); // This is a string

Installation

  1. Add a dependency on o6web/multiencoder to your composer.json file if you use Composer to manage the dependencies of your project:
composer require o6web/multiencoder

Although it's recommended to use Composer, you can actually include the file(s) any way you want.

License

MultiEncoder is MIT licensed.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages