kind_uuid 1.0.1 copy "kind_uuid: ^1.0.1" to clipboard
kind_uuid: ^1.0.1 copied to clipboard

discontinued

A performant UUID implementation that supports the two common UUID versions (1 and 4) and two IETF standard drafts (6 and 7).

example/example.dart

import 'package:kind_uuid/kind_uuid.dart';

void main() {
  // We recommend you to use the default constructor so you can make
  // application-wide changes with Uuid.setDefaultFactory(...).
  final uuid = Uuid();
  print('UUID: $uuid');
  print('UUID bytes: ${uuid.toBytes()}');

  // Construct an UUID with version 1.
  final timestamped = Uuid.timestampedV1();
  print('Timestamped UUID timestamp: ${timestamped.dateTime()}');

  // Parse a string
  final parsedUuid = Uuid.parse('f81d4fae-7dec-11d0-a765-00a0c91e6bf6');
  print('UUID from string: $parsedUuid');

  // Read bytes
  final uuidFromBytes = Uuid.fromBytes(
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
  );
  print('UUID from bytes: $uuidFromBytes');
}
0
likes
90
points
23
downloads

Publisher

verified publisherdint.dev

Weekly Downloads

A performant UUID implementation that supports the two common UUID versions (1 and 4) and two IETF standard drafts (6 and 7).

Homepage

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

clock, collection, meta

More

Packages that depend on kind_uuid