human_readable_ids 1.0.0 human_readable_ids: ^1.0.0 copied to clipboard
A dart plugin to generate human-readable ids from an english lists of nouns and adjectives.
example/human_readable_ids_example.dart
import 'package:human_readable_ids/human_readable_ids.dart';
void main() async {
/// short hand
print('id: ${humanReadableId()}');
/// Longer version
var generator = HumanReadableIdGenerator();
print('id: ${generator.generate()}');
print('id: ${generator.generate()}');
/// customize the generator
var stupidGenerator = HumanReadableIdGenerator(
numericIdsRange: 1,
nouns: ["john"],
adjectives: ['genius'],
);
print('id: ${stupidGenerator.generate()}');
assert(stupidGenerator.generate() == stupidGenerator.generate());
}