PHP code example of qroques / resilient-data
1. Go to this page and download the library: Download qroques/resilient-data library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
qroques / resilient-data example snippets
$resilientData = new Qroques\ResilientData\ResilientData(file_get_contents(__DIR__.'/data/lorem.txt'));
// We want to split the data into 5 parts, and we want to be able to recover the data even with 2 parts missing
$splittingConfiguration = new Qroques\ResilientData\SplittingConfiguration(5, 2);
$splitter = new Qroques\ResilientData\Splitter();
$fragments = $splitter->split($resilientData, $splittingConfiguration);
$assembler = new Qroques\ResilientData\Assembler();
$resilientData = $splitter->assemble($fragments);