Skip to content

Instantly share code, notes, and snippets.

@rudiedirkx
Created March 22, 2025 16:25
Show Gist options
  • Save rudiedirkx/53d12bc00ec1cf6bdf06ae0035687a34 to your computer and use it in GitHub Desktop.
Save rudiedirkx/53d12bc00ec1cf6bdf06ae0035687a34 to your computer and use it in GitHub Desktop.
<?php
function incrotate(int $startLength, string $in) : string {
$len = $startLength;
$out = '';
while (strlen($out) < strlen($in)) {
$part = substr($in, strlen($out), $len);
$out .= strrev($part);
$len++;
}
return $out;
}
$in = json_encode([
'oele' => 'boele',
'bla' => 'dus want',
'foo' => 'bar',
'baz' => 123,
]);
$out = incrotate(2, base64_encode($in));
var_dump($out);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment