mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2024-09-20 05:25:36 +00:00
17 lines
287 B
Dart
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;
|
|
}
|