We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for yenc encoded overviews
The text was updated successfully, but these errors were encountered:
The following (basic) code works:
$yEncodedString = 'ybegin**** (yencoded string ******)'; $encoded = array(); // Extract the yEnc string itself. preg_match("/^(=ybegin.*=yend[^$]*)$/ims", $yEncodedString, $encoded); if (!isset($encoded[1])) { return false; } $encoded = $encoded[1]; // Remove the header and trailer from the string before parsing it. $encoded = preg_replace("/(^=ybegin.*\\r\\n)/im", "", $encoded, 1); $encoded = preg_replace("/(^=ypart.*\\r\\n)/im", "", $encoded, 1); $encoded = preg_replace("/(^=yend.*)/im", "", $encoded, 1); // Remove linebreaks from the string. $encoded = trim(str_replace("\r\n", "", $encoded)); // Decode $decoded = ''; for( $i = 0; $i < strlen($encoded); $i++) { if ($encoded{$i} == "=") { $i++; $decoded .= chr((ord($encoded{$i}) - 64) - 42); } else { $decoded .= chr(ord($encoded{$i}) - 42); } } // Do something with the $decoded
Sorry, something went wrong.
@kissifrot can you create a PR for this functionality?
No branches or pull requests
Add support for yenc encoded overviews
The text was updated successfully, but these errors were encountered: