{"id":15016803,"url":"https://github.com/sqids/sqids-perl","last_synced_at":"2025-10-29T01:36:31.833Z","repository":{"id":176746993,"uuid":"658042195","full_name":"sqids/sqids-perl","owner":"sqids","description":"Official Perl port of Sqids. Generate short unique IDs from numbers.","archived":false,"fork":false,"pushed_at":"2024-04-06T22:10:11.000Z","size":21,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T19:49:06.856Z","etag":null,"topics":["hashids","id","id-generator","perl","perl5","short-id","short-url","sqids","uid","unique-id","unique-id-generator"],"latest_commit_sha":null,"homepage":"https://sqids.org/perl","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sqids.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-24T15:29:56.000Z","updated_at":"2025-03-12T01:42:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"edd8d263-49fb-4be2-a976-7d83cc65a008","html_url":"https://github.com/sqids/sqids-perl","commit_stats":null,"previous_names":["sqids/sqids-perl"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sqids/sqids-perl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-perl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-perl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-perl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-perl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqids","download_url":"https://codeload.github.com/sqids/sqids-perl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-perl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281544212,"owners_count":26519552,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hashids","id","id-generator","perl","perl5","short-id","short-url","sqids","uid","unique-id","unique-id-generator"],"created_at":"2024-09-24T19:49:24.448Z","updated_at":"2025-10-29T01:36:31.819Z","avatar_url":"https://github.com/sqids.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Actions Status](https://github.com/sqids/sqids-perl/actions/workflows/test.yml/badge.svg)](https://github.com/sqids/sqids-perl/actions)\n# NAME\n\nSqids - generate short unique identifiers from numbers\n\n# SYNOPSIS\n\n    use Sqids;\n    my $sqids = Sqids-\u003enew;\n\n    # encode/decode a single number\n    my $id = $sqids-\u003eencode(123);         # 'UKk'\n    my $num = $sqids-\u003edecode('UKk');      # 123\n\n    # or a list or arrayref\n    $id = $sqids-\u003eencode(1, 2, 3);        # '86Rf07'\n    $id = $sqids-\u003eencode([1, 2, 3]);      # '86Rf07'\n    my @nums = $sqids-\u003edecode('86Rf07');  # (1, 2, 3)\n\n    # also get results in an arrayref\n    my $nums = $sqids-\u003edecode('86Rf07');  # [1, 2, 3]\n\n# DESCRIPTION\n\n[Sqids](https://sqids.org/perl) (_pronounced \"squids\"_) is a small\nlibrary that lets you **generate unique IDs from numbers**. It's good for link\nshortening, fast \u0026 URL-safe ID generation and decoding back into numbers for\nquicker database lookups.\n\nFeatures:\n\n- **Encode multiple numbers** - generate short IDs from one or several non-negative numbers\n- **Quick decoding** - easily decode IDs back into numbers\n- **Unique IDs** - generate unique IDs by shuffling the alphabet once\n- **ID padding** - provide minimum length to make IDs more uniform\n- **URL safe** - auto-generated IDs do not contain common profanity\n- **Randomized output** - Sequential input provides nonconsecutive IDs\n- **Many implementations** - Support for [40+ programming languages](https://sqids.org/)\n\n## Use-cases\n\nGood for:\n\n- Generating IDs for public URLs (eg: link shortening)\n- Generating IDs for internal systems (eg: event tracking)\n- Decoding for quicker database lookups (eg: by primary keys)\n\nNot good for:\n\n- Sensitive data (this is not an encryption library)\n- User IDs (can be decoded revealing user count)\n\n## Getting started\n\nInstall Sqids via:\n\n    cpanm Sqids\n\n# METHODS\n\n## new\n\n    my $sqids = Sqids-\u003enew();\n\nMake a new Sqids object. This constructor accepts a few options, either\nas a hashref or a list (using [Class::Tiny](https://metacpan.org/pod/Class%3A%3ATiny)):\n\n    my $sqids = Sqids-\u003enew(\n        alphabet =\u003e 'abcdefg',\n        min_length =\u003e 4,\n        blocklist =\u003e ['word'],\n    );\n\n- alphabet\n\n    You can randomize IDs by providing a custom alphabet:\n\n        my $sqids = Sqids-\u003enew({\n          alphabet =\u003e 'FxnXM1kBN6cuhsAvjW3Co7l2RePyY8DwaU04Tzt9fHQrqSVKdpimLGIJOgb5ZE',\n        });\n        my $id = $sqids-\u003eencode(1, 2, 3); # \"B4aajs\"\n        my $numbers = $sqids-\u003edecode($id); # [1, 2, 3]\n\n- min\\_length\n\n    Enforce a _minimum_ length for IDs:\n\n        my $sqids = Sqids-\u003enew( min_length =\u003e 10 );\n        my $id = $sqids-\u003eencode(1, 2, 3); # \"86Rf07xd4z\"\n        my $numbers = $sqids-\u003edecode($id); # [1, 2, 3]\n\n- blocklist\n\n    Prevent specific words from appearing anywhere in the auto-generated IDs:\n\n        my $sqids = Sqids-\u003enew( blocklist =\u003e ['86Rf07'] );\n        my $id = $sqids-\u003eencode([1, 2, 3]); # \"se8ojk\"\n        my $numbers = $sqids-\u003edecode($id); # [1, 2, 3]\n\n## encode\n\n    my $id = $sqids-\u003eencode($n1, [$n2, ...]);\n\nEncode a single number (or a list of numbers, or a single arrayref of numbers) into a string.\n\n## decode\n\n    my @numbers = $sqids-\u003edecode($id);\n\nDecode an id into its number (or numbers). Returns a list in list context,\nor a scalar (one number) or arrayref (multiple numbers) in scalar context.\n\n**Note**: Because of the algorithm's design, **multiple IDs can decode back\ninto the same sequence of numbers**. If it's important to your design that IDs\nare canonical, you have to manually re-encode decoded numbers and check that\nthe generated ID matches.\n\n# SEE ALSO\n\n[Sqids](https://sqids.org)\n\n# LICENSE\n\nCopyright (C) Matthew Somerville. MIT.\n\n# AUTHOR\n\nMatthew Somerville \u003cmatthew@mysociety.org\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqids%2Fsqids-perl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqids%2Fsqids-perl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqids%2Fsqids-perl/lists"}