Dart TypeID

A spec conformant implementation of typeid in Dart.

GitHub License GitHub Actions Workflow Status

Note

This repo contains the typeid repo as a submodule to reflect which version of the spec has been implemented and to maintain a single source of truth for test vectors

Usage

ID Generation

import 'package:typeid/src/typeid.dart';

void main() {
  final id = TypeId.generate('user');
  print(id);
}

Decoding

import 'package:typeid/src/typeid.dart';

void main() {
  final id = TypeId.decode('user_01hsq6r6amekxrefpecdfp561f');
  
  print(decoded.prefix);
  print(decoded.suffix);
  print(decoded.uuid.version);
}

Libraries

typeid
Support for doing something awesome.