dart_wordlists 0.1.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 49

dart_wordlists

A library for passphrase word lists. Inspired by Diceware and others

Created from templates made available by Stagehand under a BSD-style license.

Usage

A simple usage example:

    import 'package:dart_wordlists/dart_wordlists.dart';
    import 'package:dart_collection_sampler/dart_collection_sampler.dart';
    
    import 'package:args/args.dart';
    
    
    main(List<String> arguments) async {
      var argParser = new ArgParser()
        ..addOption("num", abbr: "n",
            help: "items to pick from rest of command line",
            defaultsTo: "6");
    
      var results = argParser.parse(arguments);
    
      sample(int.parse(results["num"]));
    }
    
    sample(int sampleSize) async {
      var loader = new WordlistLoader();
    
      var sampler = new CollectionSampler();
    
      var wordlists = [
        Wordlist.bip39_en,
        Wordlist.bip39_zh_CW,
        Wordlist.diceware_beale_en,
        Wordlist.eff_large_en
      ];
      for (var wl in wordlists) {
        var meta = loader.findMetadata(wl);
        print(loader.findMetadata(wl));
    
        var words = await loader.findLoader(wl).load();
        print(words);
    
        print ("sample: ${sampler.pickN(words, sampleSize)}");
        print ("\n");
      }
    }

Features and bugs

Please file feature requests and bugs at the issue tracker.

Similar projects

Credits

Diceware

diceware is a concept invented by Arnold G. Reinhold, Cambridge, Massachusetts USA.

The English Diceware Wordlists used with this programme are licensed by Arnold G. Reinhold (files wordlists/wordlist_en_orig.asc, wordlists/wordlist_en.txt) under the Creative Commons CC-BY 3.0 license (see http://creativecommons.org/licenses/by/3.0/).

"Diceware" is a trademark of A G Reinhold.

EFF

The EFF wordlist (file wordlsts/wordlist_en_eff.txt) is licensed by the Electronic Frontier Foundation under the Creative Commons CC-BY 3.0 US license (see https://creativecommons.org/licenses/by/3.0/us/).

See EFF's New Wordlists for Random Passphrases

BIP39

See BIP39

Changelog

0.1.1

  • add unit test for entropy

0.1.0

  • change diceware-style parser to return Map<String,String>
  • add method to calculate entropy per word from wordlist

0.0.2

  • in CLI example, don't select unique words

0.0.1

  • Initial version

1. Depend on it

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


dependencies:
  dart_wordlists: "^0.1.1"

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 packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_wordlists/dart_wordlists.dart';
        
Version Uploaded Documentation Archive
0.1.1 Dec 10, 2017 Go to the documentation of dart_wordlists 0.1.1 Download dart_wordlists 0.1.1 archive
0.1.0 Dec 10, 2017 Go to the documentation of dart_wordlists 0.1.0 Download dart_wordlists 0.1.0 archive
0.0.2 Dec 8, 2017 Go to the documentation of dart_wordlists 0.0.2 Download dart_wordlists 0.0.2 archive
0.0.1 Dec 4, 2017 Go to the documentation of dart_wordlists 0.0.1 Download dart_wordlists 0.0.1 archive

Analysis

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

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
96 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
49
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:dart_wordlists/dart_wordlists.dart with components: isolate.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 hints.

    Run dartfmt to format lib/dart_wordlists.dart.

    Run dartfmt to format lib/src/dart_wordlists_base.dart.

    Similar analysis of the following files failed:

    • lib/src/wordlist_parser.dart (hint)
  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use dart_wordlists.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
resource >=2.1.2 <3.0.0 2.1.2
Transitive dependencies
typed_data 1.1.5
Dev dependencies
args >=0.13.4 <2.0.0
dart_collection_sampler >=0.5.1
test ^0.12.0