xxtea 2.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 97

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.3 #

  • Fixed some hints.

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.3

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]
94
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]
97
Learn more about scoring.

We analyzed this package on Jul 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15

Health issues and suggestions

Document public APIs. (-1 points)

12 out of 12 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

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