패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.5.6

zstandard_platform_interface

zstandard 플러그인을 위한 일반적인 플랫폼 인터페이스입니다.

AndroidiOSLinuxmacOSWebWindows
30일 다운로드
5.2만
좋아요
1
Pub 점수
150

패키지 설치

flutter pub add zstandard_platform_interface

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

zstandard 압축 플러그인을 위한 공유 플랫폼 인터페이스로, Android, iOS, Linux, macOS, Web, Windows에서 Zstandard 압축 및 해제를 일관되게 통합할 수 있도록 합니다. 이 패키지는 플랫폼별 구현을 추상화하여 개발자가 모든 지원되는 플랫폼에서 원활하게 작동하는 통합 코드를 작성할 수 있도록 합니다. 다른 zstandard 관련 패키지의 기반 역할을 하며 유지보수성을 높이고 중복을 줄입니다. 인터페이스는 플랫폼별 구현에 의해 확장될 수 있도록 설계되어, 호환성과 성능을 보장하면서도 API는 안정적으로 유지됩니다.

사용 사례

  • 크로스 플랫폼 압축 유틸리티
  • 다중 플랫폼 앱에서의 통합 데이터 압축
  • zstandard 기반 파일 처리와의 통합
  • 효율적인 데이터 저장 및 전송 지원
  • Zstandard 압축에 의존하는 플러그인 빌드

주요 기능

  • 공유 플랫폼 인터페이스
  • 다중 플랫폼 지원 (Android, iOS, Linux, macOS, Web, Windows)
  • 플랫폼 전용 구현을 위한 확장 가능한 설계
  • 안정적이고 일관된 API
  • Zstandard용 플러그인 개발을 촉진합니다

적합한 대상

  • 크로스 플랫폼 압축 도구를 개발하는 개발자
  • 표준화된 zstandard 인터페이스가 필요한 플러그인 작성자
  • 효율적이고 플랫폼에 구애받지 않는 데이터 압축이 필요한 앱
  • 공유 로직을 사용하여 여러 플랫폼 빌드를 관리하는 팀

고려 사항

  • 플랫폼별 패키지에 의해 구현되어야 합니다
  • 플랫폼 확장 없이는 자체적으로 사용할 수 없습니다
  • 하위 zstandard 라이브러리의 올바른 설정에 의존
  • 웹 또는 Windows 환경에서는 추가 구성이 필요할 수 있습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

pub package
pub package
codecov

Zstandard

Zstandard (zstd) is a fast, high-compression algorithm developed by Meta (formerly Facebook) designed for real-time compression scenarios. It offers a flexible range of compression levels, allowing both high-speed and high-ratio compression, making it ideal for applications with diverse performance needs. Zstandard is widely used in data storage, transmission, and backup solutions.

This repository contains a federated Flutter plugin and a CLI package for zstandard compression, enabling both in-app and command-line usage. The two main components are:

  • zstandard: A Flutter plugin for cross-platform compression, supporting mobile, desktop, and web platforms. This package integrates the zstd library through FFI for native platforms and WebAssembly for the web, allowing efficient data compression in any Flutter environment.

  • zstandard_cli: A pure Dart package providing CLI capabilities for macOS, Windows, and Linux. It enables command-line compression and decompression for data files and streams.

Native platform packages and the CLI share the zstd C source and FFI bindings via the zstandard_native package (zstandard_native/src/zstd/). zstandard_native is published to pub.dev as part of this repo’s release set, so a single copy is used whether you depend on the plugin from the repo or from pub.dev.


Compatibility

Android iOS Web macOS Windows Linux Fuchsia
Flutter :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: (wasm) :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: ❌
Native FFI FFI WebAssembly FFI FFI FFI ❌
Precompiled No No Yes No No No ❌
macOS Windows Linux
x64 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
arm64 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Precompiled Yes Yes Yes

Documentation

Full documentation is in the docs/ directory, including:


Basic Usage

In-App (Flutter)
import 'package:zstandard/zstandard.dart';

void main() async {
  final zstandard = Zstandard();

  Uint8List originalData = Uint8List.fromList([...]);

  Uint8List? compressed = await zstandard.compress(originalData, 3);
  
  final decompressed = compressed == null
      ? null
      : await zstandard.decompress(compressed, maxOutputSize: 64 * 1024 * 1024);
}

Using extensions:

import 'package:zstandard/zstandard.dart';

void main() async {
  Uint8List originalData = Uint8List.fromList([...]);

  Uint8List? compressed = await originalData.compress();
  
  final decompressed = await compressed.decompress(
    maxOutputSize: 64 * 1024 * 1024,
  );
}
Command Line (zstandard_cli)
# Compress a file with a specified compression level
dart run zstandard_cli:compress --level 3 myfile.txt

# Decompress a file
dart run zstandard_cli:decompress myfile.txt.zstd
Dart Code Example (CLI)
import 'package:zstandard_cli/zstandard_cli.dart';

void main() async {
  var cli = ZstandardCLI();

  final originalData = Uint8List.fromList([...]);

  final compressed = await cli.compress(originalData, compressionLevel: 3);

  final decompressed = await cli.decompress(compressed ?? Uint8List(0));
}

Using extensions in Dart:

import 'package:zstandard_cli/zstandard_cli.dart';

void main() async {
  final originalData = Uint8List.fromList([...]);

  final compressed = await originalData.compress(compressionLevel: 3);

  final decompressed = await compressed.decompress();
}

Screenshots

Compression and Decompression Samples
macOS

Windows

Linux

Flutter Plugin (Android, iOS, macOS, Web, Windows, Linux)


License

This project uses code from the original facebook/zstd repository. Please see the LICENSE file for more information.

카테고리

의존성

의존성 목록 1 개

  • plugin_platform_interface^2.1.8

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.

순위