{"id":14966078,"url":"https://github.com/bbkr/tinyid","last_synced_at":"2025-08-24T04:20:00.810Z","repository":{"id":55655934,"uuid":"62080649","full_name":"bbkr/TinyID","owner":"bbkr","description":"Shorten and obfuscate IDs in Raku language.","archived":false,"fork":false,"pushed_at":"2024-05-07T20:12:41.000Z","size":27,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T06:51:21.564Z","etag":null,"topics":["encoding","raku"],"latest_commit_sha":null,"homepage":"","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbkr.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-06-27T19:01:35.000Z","updated_at":"2024-05-07T20:12:44.000Z","dependencies_parsed_at":"2024-09-14T01:22:23.838Z","dependency_job_id":"7cc64b68-08cf-4585-a6fb-56f0d4eee1a6","html_url":"https://github.com/bbkr/TinyID","commit_stats":{"total_commits":30,"total_committers":3,"mean_commits":10.0,"dds":0.06666666666666665,"last_synced_commit":"84782a007a37070f4822c039aa1b161ec6d0319e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bbkr/TinyID","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkr%2FTinyID","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkr%2FTinyID/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkr%2FTinyID/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkr%2FTinyID/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbkr","download_url":"https://codeload.github.com/bbkr/TinyID/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkr%2FTinyID/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271790623,"owners_count":24821634,"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-08-24T02:00:11.135Z","response_time":111,"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":["encoding","raku"],"created_at":"2024-09-24T13:35:47.826Z","updated_at":"2025-08-24T04:20:00.719Z","avatar_url":"https://github.com/bbkr.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shorten and obfuscate IDs in [Raku](https://www.raku.org) language\n\n[![test](https://github.com/bbkr/TinyID/actions/workflows/test.yml/badge.svg)](https://github.com/bbkr/TinyID/actions/workflows/test.yml)\n\n## SYNOPSIS\n\n```raku\n    use TinyID;\n    \n    my $key = ( 'a'..'z', 'A'..'Z', 0..9 ).flat.pick( * ).join;\n    # example key is '2BjLhRduC6Tb8Q5cEk9oxnFaWUDpOlGAgwYzNre7tI4yqPvXm0KSV1fJs3ZiHM'\n    \n    my $tinyid = TinyID.new( key =\u003e $key );\n    \n    say $tinyid.encode( 48888851145 );  # will print '1FN7Ab'\n    say $tinyid.decode( '1FN7Ab' );     # will print 48888851145\n```\n\n## DESCRIPTION\n\nWith the help of this module you can shorten and obfuscate your IDs at the same time. Useful for:\n\n* Hiding real database IDs in URLs or REST APIs.\n* Saving space where it is limited, like in SMS or Push messages.\n\n\n## METHODS\n\n### new( key =\u003e 'qwerty' )\n\nKeyt must consist of at least two unique unicode characters.\nThe **longer the key** - the **shorter encoded ID** will be.\nEncoded ID will be **made exclusively out of characters from the key**.\n\nChoose your key characters wisely, for example:\n\n* For SMS messages generate key from `a-z,A-Z,0-9` range. You will get excellent shortening like `1234567890` -\u003e `380FQs`.\n* For NTFS file names generate key from `a-z` range. You will get good shortening and avoid case insensitivity collisions, like `1234567890` -\u003e `iszbmfx`.\n* When trolling generate key from Emojis. So `1234567890` will be represented as `😣😄😹😧😋😳`.\n\n### encode( 123 )\n\nEncode unsigned integer into a string.\n\nNote that this should not be considered a strong encryption.\nIt does not contain consistency checks.\nAnd key is easy to reverse engineer with small amount of encoded/decoded samples given.\nTreat it as really, really fast obfuscation only.\n\n### decode( 'rer' )\n\nDecode string back into unsigned integer.\n\n## TRICKS\n\nIf you provide sequential characters in key you can convert your numbers to some weird numeric systems, for example base18:\n\n```raku\n    TinyID.new( key =\u003e '0123456789ABCDEFGH' ).encode( 48888851145 ).say;    # '47F709HFF'\n```\n\n## COMPATIBLE COUNTERPARTS\n\n* [Rust](https://crates.io/crates/squishyid) - `SquishyID`\n* [Perl](http://search.cpan.org/~bbkr/Integer-Tiny-0.3/lib/Integer/Tiny.pm) - `Integer::Tiny`\n* [PHP](https://github.com/krowinski/tinyID) - `TinyID`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbkr%2Ftinyid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbkr%2Ftinyid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbkr%2Ftinyid/lists"}