20 lines
347 B
Dart
Raw Normal View History

2024-06-25 10:03:02 +08:00
import 'package:uuid/data.dart';
import 'package:uuid/rng.dart';
2021-06-19 23:41:19 +08:00
import 'package:uuid/uuid.dart';
2024-06-25 10:03:02 +08:00
const _uuid = Uuid();
2021-06-19 23:41:19 +08:00
String uuid() {
2024-06-25 10:03:02 +08:00
return _uuid.v4();
}
String fixedUuid(int seed, UuidType type) {
return _uuid.v4(config: V4Options(null, MathRNG(seed: seed + type.index)));
}
enum UuidType {
// 0.6.0
publicSpace,
privateSpace,
2021-06-19 23:41:19 +08:00
}