cuid2 3.1.0 copy "cuid2: ^3.1.0" to clipboard
cuid2: ^3.1.0 copied to clipboard

A dart implementaion of the secure, collision-resistant ids optimized for horizontal scaling and performance (v2).

example/cuid2_example.dart

import 'package:cuid2/cuid2.dart';

void main() {
  final id = cuid();
  final id30 = cuidSecure(30);

  int Function() myCounter(int start) {
    return () => start += 5;
  }

  String myfingerprint() {
    return "klsdflsdflvcxlkaweporweqwqs";
  }

  final myCuid = cuidConfig(counter: myCounter(0), fingerprint: myfingerprint);
  final idc = myCuid.gen();

  print(id); // eh82waoo5fi41lgncwv5oxxb
  print(id30); // oxjkyfqo3aqk3jigelnuyp3ef299qx
  print(idc); // xh32wamo5gi41lgncwv3aqk3
}
7
likes
150
pub points
77%
popularity

Publisher

verified publisherobsidia.io

A dart implementaion of the secure, collision-resistant ids optimized for horizontal scaling and performance (v2).

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

pointycastle

More

Packages that depend on cuid2