my $json_str = to_json($hashref, {canonical => 1});