fix: Zstd через pure-Dart libcompress
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'dart:typed_data';
|
||||
import 'dart:isolate';
|
||||
import 'package:dart_lz4/dart_lz4.dart';
|
||||
import 'package:es_compression/zstd.dart';
|
||||
import 'package:libcompress/libcompress.dart';
|
||||
import 'package:msgpack_dart/msgpack_dart.dart' as msgpack;
|
||||
|
||||
/// ver(1) + cmd(1) + seq(2) + opcode(2) + packedLen(4) = 10
|
||||
@@ -162,8 +162,7 @@ Uint8List _decompressPayload(Uint8List src) {
|
||||
src[2] == 0x2F &&
|
||||
src[3] == 0xFD) {
|
||||
try {
|
||||
final out = zstd.decode(src);
|
||||
return out is Uint8List ? out : Uint8List.fromList(out);
|
||||
return ZstdCodec().decompress(src);
|
||||
} catch (e) {
|
||||
throw Exception('Zstd decompression error: $e');
|
||||
}
|
||||
|
||||
+8
-16
@@ -1,14 +1,6 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.7.0"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -145,14 +137,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.8"
|
||||
es_compression:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: es_compression
|
||||
sha256: c1ff7af54802631cf5c3942cb67bb99daadcc087f573ca99a9de91002d1a7ece
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.15"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -365,6 +349,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
libcompress:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: libcompress
|
||||
sha256: "1f55be8dc9e622efa1584ad899e05880d71469b7107f35be1858e91d0fadf1d4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ dependencies:
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.8
|
||||
dart_lz4: ^1.0.0
|
||||
es_compression: ^2.0.15
|
||||
libcompress: ^1.0.0
|
||||
msgpack_dart: ^1.0.1
|
||||
logger: ^2.6.2
|
||||
device_info_plus: 12.3.0
|
||||
|
||||
Reference in New Issue
Block a user