lzstring 1.0.1+2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new62

lzstring_dart #

Dart implementation of lz-string compression algorithm

The original JavaScript version is here

Usage #

String compressedString = LZString.compress('Some String');
String decompressedString = LZString.decompress(compressedString);

For more usage, please read the exapmle in example folder

Running test #

pub run test test/lz_string.dart

1.0.1+2 #

  • Update document comments

1.0.1 #

  • Fix issue which makes non english characters cannot be decompress
  • Add document comments

1.0.0 #

  • Initial commit

example/main.dart

import 'package:lzstring/lzstring.dart';

void main() { 
  String input = "Dart implemntation of lz-string";
  print('Input: $input');
  print('Compressed String: ${LZString.compress(input)}');
  print('Compressed Base 64 String: ${LZString.compressToBase64(input)}');
  print('Compressed UTF16 String: ${LZString.compressToUTF16(input)}');
  print(
      'Compressed Encoded URI Component: ${LZString.compressToEncodedURIComponent(input)}');
  print('Compressed Uint8 Array: ${LZString.compressToUint8Array(input)}');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  lzstring: ^1.0.1+2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:lzstring/lzstring.dart';
  
Version Uploaded Documentation Archive
1.0.1+2 Apr 10, 2019 Go to the documentation of lzstring 1.0.1+2 Download lzstring 1.0.1+2 archive
1.0.1+1 Apr 10, 2019 Go to the documentation of lzstring 1.0.1+1 Download lzstring 1.0.1+1 archive
1.0.1 Apr 10, 2019 Go to the documentation of lzstring 1.0.1 Download lzstring 1.0.1 archive
1.0.0+1 Apr 2, 2019 Go to the documentation of lzstring 1.0.0+1 Download lzstring 1.0.0+1 archive
1.0.0 Apr 2, 2019 Go to the documentation of lzstring 1.0.0 Download lzstring 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
25
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Apr 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:lzstring/lzstring.dart.

Health suggestions

Fix lib/lzstring.dart. (-1 points)

Analysis of lib/lzstring.dart reported 2 hints:

line 347 col 3: Prefer using /// for doc comments.

line 366 col 9: The value of the local variable 'next' isn't used.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.17.0 <3.0.0
typed_data ^1.0.0 1.1.6
Dev dependencies
test ^1.0.0