shortuid 1.0.0 copy "shortuid: ^1.0.0" to clipboard
shortuid: ^1.0.0 copied to clipboard

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

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://github.com/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.

6
likes
130
points
28
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

uuid

More

Packages that depend on shortuid