Skip to content

Commit

Permalink
Revert "change README for Usage"
Browse files Browse the repository at this point in the history
This reverts commit fa8dde1.
  • Loading branch information
wanglulu committed Feb 22, 2020
1 parent fa8dde1 commit 0654854
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,8 @@

## Usage

Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:

```
dependencies:
flutter_aes_ecb_pkcs5: ^0.1.1
```

2. Install it You can install packages from the command line:

with Flutter:

```
$ flutter pub get
```

Alternatively, your editor might support 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:flutter_aes_ecb_pkcs5/flutter_aes_ecb_pkcs5.dart';
```



#### AES Use Example


#### AES

```dart
import 'package:flutter_aes_ecb_pkcs5/flutter_aes_ecb_pkcs5.dart';
Expand All @@ -46,15 +18,15 @@ void main() {
var data = "{\"username\":\"helloword\"}";
//generate a 16-byte random key
//生成16字节的随机密钥
var key = await FlutterAesEcbPkcs5.generateDesKey(128);
print(key);
//encrypt
//加密
var encryptText = await FlutterAesEcbPkcs5.encryptString(data, key);
print(encryptText);
//decrypt
//解密
var decryptText = await FlutterAesEcbPkcs5.decryptString(encryptText, key);
print(decryptText);
Expand Down

0 comments on commit 0654854

Please sign in to comment.