{"id":15649895,"url":"https://github.com/book/data-shortnameprovider","last_synced_at":"2025-06-20T20:34:42.843Z","repository":{"id":17008709,"uuid":"19772019","full_name":"book/Data-ShortNameProvider","owner":"book","description":"Create short names containing useful information","archived":false,"fork":false,"pushed_at":"2015-04-21T09:02:13.000Z","size":240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T01:45:16.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://metacpan.org/pod/Data::ShortNameProvider","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/book.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-05-14T08:28:02.000Z","updated_at":"2015-04-21T09:02:11.000Z","dependencies_parsed_at":"2022-09-06T21:40:46.723Z","dependency_job_id":null,"html_url":"https://github.com/book/Data-ShortNameProvider","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/book%2FData-ShortNameProvider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/book%2FData-ShortNameProvider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/book%2FData-ShortNameProvider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/book%2FData-ShortNameProvider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/book","download_url":"https://codeload.github.com/book/Data-ShortNameProvider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246258871,"owners_count":20748573,"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-03T12:32:27.275Z","updated_at":"2025-03-30T00:13:37.852Z","avatar_url":"https://github.com/book.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n\nData::ShortNameProvider - Generate short names with style\n\nSYNOPSIS\n\nCreate a name provider:\n\n    my $np = Data::ShortNameProvider-\u003enew(\n        style           =\u003e 'Basic',       # default\n        timestamp_epoch =\u003e 1400023019,    # defaults to time()\n        max_name_length =\u003e 32,            # croak if a longer name is generated\n\n        # style-specific arguments\n        prefix  =\u003e 'dbit',\n        version =\u003e 1,\n    );\n\nGenerate a shortname:\n\n    $short_name = $np-\u003egenerate_name('foo');   # returns \"dbit1_140513__foo\"\n\nParse a generated shortname:\n\n    $hash = $np-\u003eparse_generated_name($short_name);\n\n$hash contains something like:\n\n    # depends on the style\n    {\n        prefix          =\u003e 'dbit',\n        version         =\u003e 1,\n        timestamp       =\u003e '140513',\n        timestamp_epoch =\u003e 1400023019,\n        name            =\u003e 'foo',\n    }\n\nor \"undef\" if $short_name could not be parsed as a short name generated\nwith that style.\n\nCheck if a string is parsable:\n\n    my @names = grep { $np-\u003eis_generated_name($_) } @names;\n\nDESCRIPTION\n\nCreate short names that encode a timestamp and a fixed label in a format\nthat's unlikely to match normal names.\n\nA typical use-case would be the creation of database table names or file\nnames in situations where you need to minimize the risk of clashing with\nexisting items.\n\nThe generated names can be detected and parsed to extract the timestamp\nand other components.\n\nACKNOWLEDGEMENTS\n\nThis module is based on an idea and proposal by Tim Bunce, on the\n\"dbi-dev\" mailing-list.\n\nThe initial thread about Test::Database shortcomings:\n\u003chttp://www.nntp.perl.org/group/perl.dbi.dev/2014/04/msg7792.html\u003e\n\nTim's proposal for a short name provider:\n\u003chttp://www.nntp.perl.org/group/perl.dbi.dev/2014/05/msg7815.html\u003e\n\nThe first implementaion of the module was written during the first two\ndays of the Perl QA Hackathon 2015 in Berlin (with Tim Bunce providing\nextensive feedback on IRC). Many thanks to TINITA for organizing this\nevent!\n\nAUTHOR\n\nPhilippe Bruhat (BooK), \u003cbook@cpan.org\u003e.\n\nCOPYRIGHT\n\nCopyright 2014-2015 Philippe Bruhat (BooK), all rights reserved.\n\nLICENSE\n\nThis program is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbook%2Fdata-shortnameprovider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbook%2Fdata-shortnameprovider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbook%2Fdata-shortnameprovider/lists"}