Skip to content

Commit

Permalink
chore: example & readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ethicnology committed Jul 10, 2022
1 parent 6f99d6a commit 7302f00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ void main() {
// NFKD word formatting is mandatory in BIP39, please take care: https://github.com/flutter/flutter/issues/104927#issuecomment-1141140735
var french = Language.french;
String nfkdDisabled = 'échelle';
String nfkdEnabled = 'échelle';
print(french.isValid(nfkdDisabled)); // false
print(french.isValid(nfkdEnabled)); // true
print(french.isValid(nfkd(nfkdDisabled))); // NFKD formatted using unorm
String nonNfkd = 'échelle';
String nfkd = 'échelle';
print(french.isValid(nfkd)); // true
print(french.isValid(nonNfkd)); // true, because isValid formats input
}
```
10 changes: 4 additions & 6 deletions example/bip39_mnemonic_example.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:bip39_mnemonic/bip39_mnemonic.dart';
import 'package:convert/convert.dart'; // convert bytes to hexadecimal and vice-versa
import 'package:unorm_dart/unorm_dart.dart';

void main() {
// DO NOT USE THESE DATA!
Expand Down Expand Up @@ -36,9 +35,8 @@ void main() {

// NFKD word formatting is mandatory in BIP39, please take care: https://github.com/flutter/flutter/issues/104927#issuecomment-1141140735
var french = Language.french;
String nfkdDisabled = 'échelle';
String nfkdEnabled = 'échelle';
print(french.isValid(nfkdDisabled)); // false
print(french.isValid(nfkdEnabled)); // true
print(french.isValid(nfkd(nfkdDisabled))); // NFKD formatted using unorm
String nonNfkd = 'échelle';
String nfkd = 'échelle';
print(french.isValid(nfkd)); // true
print(french.isValid(nonNfkd)); // true, because isValid formats input}
}

0 comments on commit 7302f00

Please sign in to comment.