Skip to content

Package to generate Generate UUIDs or short uuids (32/64 bit Guid), RFC4122 v4-compliant UUIDs

License

Notifications You must be signed in to change notification settings

parz3val/dart-shortid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShortUid

A Dart package for generating short unique identifiers based on UUIDV4 and converting them back and forth. RFC 4122 compliant.

Features

  • Convert UUIDv4 to short unique identifier (SID) and vice versa.
  • Generate random short unique identifiers.

Usage

Convert UUIDv4 to SID

import 'package:shortuid/shortuid.dart';

final uuidv4 = 'd07b31c0-54d9-44d4-993d-ef8101ee1dad';
final shortuid = ShortUid.from_uid(uuidv4);

Convert SID to UUIDv4

import 'package:shortuid/shortuid.dart';

final shortuid = '2n9c';
final uuidv4 = ShortUid.decode_to_uid(shortuid);

Generate random SID

import 'package:shortuid/shortuid.dart';

final shortuid = ShortUid.create();

Additional Information

This package is designed to play nice with the python : https:/skorokithakis/shortuuid/tree/master and npm package : https://www.npmjs.com/package/short-uuid.

Most packages generated bad shortids that were not compatible with each other, issue is solved by using the same alphabet as the shortuuid python and short-uuid npm pacakge.

About

Package to generate Generate UUIDs or short uuids (32/64 bit Guid), RFC4122 v4-compliant UUIDs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages