Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pub" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
commit-message:
prefix: "chore(deps)"
include: "scope"
37 changes: 37 additions & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Dart

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1

- name: Install dependencies
run: dart pub get

# Verify the use of 'dart format' on each commit.
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze project source
run: dart analyze --fatal-infos

# Your project will need to have tests in test/ and a dependency on
# package:test for this step to succeed. Note that Flutter projects will
# want to change this to 'flutter test'.
- name: Run tests
run: dart test
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 dropbear-software

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![pub package](https://img.shields.io/pub/v/base32_codec.svg)](https://pub.dev/packages/resource_id)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Open in Firebase Studio](https://cdn.firebasestudio.dev/btn/open_light_20.svg)](https://studio.firebase.google.com/import?url=https%3A%2F%2Fgithub.com%2Fdropbear-software%2Fresource_id)

# ResourceId

A Dart package for creating, parsing, and validating robust, immutable, and URL-safe resource identifiers.
Expand Down Expand Up @@ -148,6 +152,6 @@ UUIDs (Universally Unique Identifiers) are a common standard for generating uniq
| **Readability** | `123e4567-e89b-12d3-a456-426655440000` | `books/BKB3X-YT465-KZ69` | Easier for humans to read, transcribe, and share. Uses a character set that avoids common visual ambiguities. |
| **Typo Detection** | None | Built-in Checksum | `ResourceId.parse()` instantly detects typos or copy-paste errors, preventing "not found" errors from ever hitting your database. |
| **Resource Context** | No | Prefixed (`books/...`) | Identifiers are self-describing, which makes debugging, logging, and reading API requests much clearer. |
Flexible (e.g., 64 bits) - Allows you to choose a smaller, more performant size (like a `BIGINT`) for resources that don't require global uniqueness, optimizing database performance. Also enforces a minimum size of 1 byte to ensure valid identifiers.
| **Size Flexibility**| Fixed at 128 bits | Flexible (e.g., 64 bits) | Allows you to choose a smaller (1 byte minimum), more performant size (like a `BIGINT`) for resources that don't require global uniqueness, optimizing database performance. |

While you can absolutely use a 128-bit `ResourceId` to wrap a UUID's raw bytes to get the best of both worlds, for most application use cases, a 64-bit `ResourceId` provides a more ergonomic, safer, and often more performant solution.
103 changes: 103 additions & 0 deletions doc/api/__404error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
<meta name="description" content="resource_id API docs, for the Dart programming language.">
<title>resource_id - Dart API docs</title>



<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet">

<link rel="stylesheet" href="static-assets/github.css?v1">
<link rel="stylesheet" href="static-assets/styles.css?v1">
<link rel="icon" href="static-assets/favicon.png?v1">

</head>

<body data-base-href="" data-using-base-href="false" class="light-theme">
<div id="overlay-under-drawer"></div>
<header id="title">
<span id="sidenav-left-toggle" class="material-symbols-outlined" role="button" tabindex="0">menu</span>
<ol class="breadcrumbs gt-separated dark hidden-xs">
<li class="self-crumb">resource_id package</li>
</ol>
<div class="self-name">resource_id</div>
<form class="search navbar-right" role="search">
<input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
</form>
<button class="toggle" id="theme-button" title="Toggle between light and dark mode" aria-label="Light and dark mode toggle">
<span id="dark-theme-button" class="material-symbols-outlined" aria-hidden="true">
dark_mode
</span>
<span id="light-theme-button" class="material-symbols-outlined" aria-hidden="true">
light_mode
</span>
</button>
</header>
<main>
<div id="dartdoc-main-content" class="main-content">
<h1>404: Something's gone wrong :-(</h1>
<section class="desc">
<p>
You've tried to visit a page that doesn't exist. Luckily this site has
other <a href="index.html">pages</a>.
</p>
<div>
If you were looking for something specific, try searching:
<form class="search-body" role="search">
<input
type="text"
id="search-body"
autocomplete="off"
disabled
class="form-control typeahead"
placeholder="Loading search..."
/>
</form>
</div>
</section>
</div>
<!-- /.main-content -->
<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
<!-- The search input and breadcrumbs below are only responsively visible at low resolutions. -->
<header id="header-search-sidebar" class="hidden-l">
<form class="search-sidebar" role="search">
<input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
</form>
</header>
<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
<li class="self-crumb">resource_id package</li>
</ol>

<h5>
<span class="package-name">resource_id</span>
<span class="package-kind">package</span>
</h5>
<ol>
<li class="section-title">Libraries</li>
<li><a href="resource_id/">resource_id</a></li>
</ol>

</div>
<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right"></div>
</main>
<footer>
<span class="no-break">
resource_id
0.1.0
</span>

</footer>


<script src="static-assets/highlight.pack.js?v1"></script>
<script src="static-assets/docs.dart.js"></script>

</body>
</html>

1 change: 1 addition & 0 deletions doc/api/categories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Loading