{"id":16669463,"url":"https://github.com/bigpresh/data-censor","last_synced_at":"2025-12-28T05:39:39.459Z","repository":{"id":14940288,"uuid":"17664831","full_name":"bigpresh/Data-Censor","owner":"bigpresh","description":"Perl module to censor sensitive data","archived":false,"fork":false,"pushed_at":"2018-10-04T18:54:46.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T04:52:22.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Infoglobo/ImageGallery.Android","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigpresh.png","metadata":{"files":{"readme":"README","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-12T11:33:06.000Z","updated_at":"2020-10-15T22:10:51.000Z","dependencies_parsed_at":"2022-09-25T03:51:46.489Z","dependency_job_id":null,"html_url":"https://github.com/bigpresh/Data-Censor","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpresh%2FData-Censor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpresh%2FData-Censor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpresh%2FData-Censor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpresh%2FData-Censor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigpresh","download_url":"https://codeload.github.com/bigpresh/Data-Censor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243315527,"owners_count":20271580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T11:32:55.641Z","updated_at":"2025-12-28T05:39:39.422Z","avatar_url":"https://github.com/bigpresh.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    Data::Censor - censor sensitive stuff in a data structure\n\nVERSION\n    Version 0.02\n\nSYNOPSIS\n        # OO way, letting you specify your own list of sensitive-looking fields, and\n        # what they should be replaced by (all options here are optional)\n        my $censor = Data::Censor-\u003enew(\n            # Specify which fields to censor:\n            sensitive_fields =\u003e [ qw(card_number password) ],\n\n            # Specify text to replace their values with:\n            replacement =\u003e '(Sensitive data hidden)',\n\n            # Or specify callbacks for each field name which return the \"censored\"\n            # value - in this case, masking a card number (PAN) to show only the\n            # last four digits:\n            replacement_callbacks =\u003e {\n                card_number =\u003e sub {\n                    my $pan = shift;\n                    return \"x\" x (length($pan) - 4) . substr($pan, -4, 4);\n                },\n            },\n        );\n    \n        # Censor the data in-place (changes the data structure, returns the number\n        # of keys censored)\n        my $censor_count = $censor-\u003ecensor(\\%data);\n\n        # Alternate non-OO interface, using default settings and returning a cloned\n        # version of the data after censoring:\n        my $censored_data = Data::Censor-\u003eclone_and_censor(\\%data);\n\nnew (CONSTRUCTOR)\n    Accepts the following arguments:\n\n    sensitive_fields\n        Either an arrayref of sensitive fields, checked for equality, or a\n        regex to test against each key to see if it's considered sensitive.\n\n    replacement\n        The string to replace each value with. Any censoring callback\n        provided in `replacement_callbacks' which matches this key will take\n        precedence over this straightforward value.\n\n    replacement_callbacks\n        A hashref of key =\u003e sub {...}, where each key is a column name to\n        match, and the coderef takes the uncensored value and returns the\n        censored value, letting you for instance mask a card number but\n        leave the last 4 digits visible.\n\n        If you provide both `replacement' and `replacement_callbacks', any\n        callback defined which matches the key being considered takes\n        precedence. =back\n\nMETHODS\n  censor\n        Given a data structure (hashref), clones it and returns the cloned\n        version after censoring potentially sensitive data within.\n\n  clone_and_censor\n        Clones the provided hashref (using Clone - will die if not\n        installed), then censors the cloned data and returns it.\n\n        Can be used both as a class or object method - the former for a\n        quick way to use it without having to instantiate an object, the\n        latter if you want to apply custom settings to the object before\n        using it.\n\n          # As a class method\n          my $censored_data = Data::Censor-\u003eclone_and_censor($data);\n\n          # or as an object method\n          my $censor = Data::Censor-\u003enew( replacement =\u003e \"SECRET!\" );\n          my $censored_data = $censor-\u003eclone_and_censor($data);\n\nAUTHOR\n        David Precious (BIGPRESH), `\u003cdavidp at preshweb.co.uk\u003e'\n\n        This code was originally written for the Dancer project by myself;\n        I've pulled it out into a seperate distribution as I was using it\n        for code at work.\n\nSUPPORT\n        You can find documentation for this module with the perldoc command.\n\n            perldoc Data::Censor\n\nLICENSE AND COPYRIGHT\n        Copyright 2014 David Precious.\n\n        This program is free software; you can redistribute it and/or modify\n        it under the terms of the the Artistic License (2.0). You may obtain\n        a copy of the full license at:\n\n        http://www.perlfoundation.org/artistic_license_2_0\n\n        Any use, modification, and distribution of the Standard or Modified\n        Versions is governed by this Artistic License. By using, modifying\n        or distributing the Package, you accept this license. Do not use,\n        modify, or distribute the Package, if you do not accept this\n        license.\n\n        If your Modified Version has been derived from a Modified Version\n        made by someone other than you, you are nevertheless required to\n        ensure that your Modified Version complies with the requirements of\n        this license.\n\n        This license does not grant you the right to use any trademark,\n        service mark, tradename, or logo of the Copyright Holder.\n\n        This license includes the non-exclusive, worldwide, free-of-charge\n        patent license to make, have made, use, offer to sell, sell, import\n        and otherwise transfer the Package with respect to any patent claims\n        licensable by the Copyright Holder that are necessarily infringed by\n        the Package. If you institute patent litigation (including a\n        cross-claim or counterclaim) against any party alleging that the\n        Package constitutes direct or contributory patent infringement, then\n        this Artistic License to you shall terminate on the date that such\n        litigation is filed.\n\n        Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT\n        HOLDER AND CONTRIBUTORS \"AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED\n        WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n        PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT\n        PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT\n        HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT,\n        INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE\n        USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n        DAMAGE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpresh%2Fdata-censor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigpresh%2Fdata-censor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpresh%2Fdata-censor/lists"}