fix crash

This commit is contained in:
Christien Rioux
2023-08-05 11:33:27 -04:00
parent ef327fb963
commit 8e1ed1e3f1
8 changed files with 54 additions and 11 deletions

View File

@@ -23,6 +23,7 @@ String cryptoKindToString(CryptoKind kind) =>
const CryptoKind bestCryptoKind = cryptoKindVLD0;
Uint8List cryptoKindToBytes(CryptoKind kind) {
assert(kind == cryptoKindVLD0, 'xxx');
final b = Uint8List(4);
ByteData.sublistView(b).setUint32(0, kind);
return b;
@@ -34,6 +35,7 @@ CryptoKind cryptoKindFromString(String s) {
}
final kind =
ByteData.sublistView(Uint8List.fromList(s.codeUnits)).getUint32(0);
assert(kind == cryptoKindVLD0, 'xxx');
return kind;
}