mirror_novnc/utils/b64-to-binary.pl
Solly Ross 4ee55e0126 Fixed vnc_perf.html
This commit updates vnc_perf.html so that it works with the current
version of noVNC.  It also introduces a utility to convert noVNC session
recordings recorded in base64-mode to binary-mode recordings, since noVNC
no longer supports base64-mode.

Fixes #479.
2016-01-06 13:32:05 -05:00

18 lines
396 B
Raku
Executable File

#!/usr/bin/env perl
use MIME::Base64;
for (<>) {
unless (/^'([{}])(\d+)\1(.+?)',$/) {
print;
next;
}
my ($dir, $amt, $b64) = ($1, $2, $3);
my $decoded = MIME::Base64::decode($b64) or die "Could not base64-decode line `$_`";
my $decoded_escaped = join "", map { "\\x$_" } unpack("(H2)*", $decoded);
print "'${dir}${amt}${dir}${decoded_escaped}',\n";
}