+
+sub freeze
+{
+ my $r;
+ my $j = shift;
+ unless ($j) {
+ LogDbg('DXUser', "DXSubcommand::freeze: undefined or empty input");
+ return q{[null, '']};
+ }
+
+ eval { $r = encode_json($j) };
+ if ($@) {
+ my $dd = dd($j);
+ LogDbg('DXUser', "DXSubcommand::freeze: json error on '$dd': $@");
+ $r = qq{['$@','']};
+ }
+ return $r;
+}
+
+sub thaw
+{
+ my $r;
+ my $j = shift;
+ unless ($j) {
+ LogDbg('DXUser', "DXSubcommand::thaw: empty string on input");
+ return [undef,[0]];
+ }
+
+ return [undef, [1]] unless $j;
+ eval { $r = decode_json($j) };
+ if ($@) {
+ LogDbg('DXUser', "DXSubcommand::thaw: json error on '$j': $@");
+ $r = [$@,[0]];
+ }
+ return $r;
+}
+1;
+
+