veilidchat/lib/veilid_support/tools.dart
2023-01-09 22:50:34 -05:00

17 lines
287 B
Dart

import 'package:veilid/base64url_no_pad.dart';
bool isValidDHTKey(String key) {
if (key.length != 43) {
return false;
}
try {
var dec = base64UrlNoPadDecode(key);
if (dec.length != 32) {
return false;
}
} catch (e) {
return false;
}
return true;
}