Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/cuid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ String _timeBlock() {
return now.toRadixString(_base);
}

final int _discreteValues = pow(_base, 4);
final int _discreteValues = pow(_base, 4).toInt();
int _counter = 0;
String _counterBlock() {
_counter = _counter < _discreteValues ? _counter : 0;
Expand Down Expand Up @@ -59,6 +59,5 @@ String newCuid() {

/// isCuid validates the supplied string is a cuid
bool isCuid(String s) {
s = s ?? '';
return s.startsWith(_prefix);
}
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

name: cuid
description: cuid is a library for generating unique collision-resistant IDs optimized for horizontal scaling and performance
version: 0.1.2
version: 1.0.0-nullsafety.0
author: Levi Cook <[email protected]>
homepage: https://github.com/levicook/cuid

dev_dependencies:
test: ^1.6.4

environment:
sdk: '>=2.0.0 <3.0.0'
sdk: '>=2.12.0 <3.0.0'