xxtea 2.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 86

XXTEA for Dart #

XXTEA logo

Build Status Pub

Introduction #

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for Dart.

It is different from the original XXTEA encryption algorithm. It encrypts and decrypts String/Uint8List instead of uint32 array, and the key is also String/Uint8List.

Usage #

import 'package:xxtea/xxtea.dart';

String str = "Hello World! 你好,中国🇨🇳!";
String key = "1234567890";
String encrypt_data = xxtea.encryptToString(str, key);
print(encrypt_data)
String decrypt_data = xxtea.decryptToString(encrypt_data, key);
print(str == encrypt_data)

2.0.2 #

  • Updated description.

2.0.1 #

  • Added example.
  • Added CHANGELOG.md.
  • Updated description.
  • Formatted lib/xxtea.dart.

2.0.0 #

  • Changed the static XXTEA class to a normal class.
  • Added const xxtea.
  • Added xxteaEncrypt, xxteaDecrypt, xxteaEncryptToString, xxteaDecryptToString.
  • Fixed compatibility with Dart 2.

1.0.0 #

  • Initial Open Source release.

example/main.dart

library xxtea_test;

import 'package:xxtea/xxtea.dart';

void main() {
  String str = "Hello World! 你好,中国🇨🇳!";
  String key = "1234567890";
  String encrypt_data = xxtea.encryptToString(str, key);
  print(encrypt_data);
  String decrypt_data = xxtea.decryptToString(encrypt_data, key);
  print(decrypt_data);
}

Use this package as a library

1. Depend on it

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


dependencies:
  xxtea: ^2.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:xxtea/xxtea.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
77
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
94
Overall:
Weighted score of the above. [more]
86
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.13.1+4

Health suggestions

Fix lib/xxtea.dart. (-3.93 points)

Analysis of lib/xxtea.dart reported 8 hints, including:

line 1 col 1: Prefer using /// for doc comments.

line 22 col 21: Avoid const keyword.

line 47 col 23: Unnecessary new keyword.

line 60 col 11: Unnecessary new keyword.

line 63 col 11: Unnecessary new keyword.

Maintenance suggestions

Package is getting outdated. (-6.03 points)

The package was last published 55 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test any