Skip to content
Closed
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
5 changes: 2 additions & 3 deletions lib/src/codecs/crypt/crypt_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class CryptData {
final versionRe = RegExp(r'^(0|[1-9][0-9]*)$');
final alnumRe = RegExp(r'^[a-z0-9-]{1,32}$');
final valueRe = RegExp(r'^[a-zA-Z0-9/+.-]+$');
final b64Re = RegExp(r'^[a-zA-Z0-9/+]+$');

// id
if (!alnumRe.hasMatch(id)) {
Expand Down Expand Up @@ -132,9 +131,9 @@ class CryptData {
}

// hash (optional)
if (hash != null && !b64Re.hasMatch(hash!)) {
if (hash != null && !valueRe.hasMatch(hash!)) {
throw ArgumentError.value(
hash, 'hash', 'expected B64 string without padding');
hash, 'hash', 'must be characters in [a-zA-Z0-9/+.-]');
}
}
}
Loading