passphrase 1.0.2 copy "passphrase: ^1.0.2" to clipboard
passphrase: ^1.0.2 copied to clipboard

Generate a cryptographically random passphrase from a given in-memory word list.

example/passphrase_example.dart

import 'dart:convert';
import 'dart:io';

import 'package:passphrase/passphrase.dart';

void main() async {
  final jsonString = await File('./eff-wordlist.json').readAsString();
  final wordList = (json.decode(jsonString) as List).cast<String>();
  var passphrase = Passphrase(wordList);
  print('passphrase: ${await passphrase.generate(10)}');
  print(
      'passphrase with 100 entropy: ${await passphrase.generateWithEntropy(100)}');

  print('index of "stack": ${passphrase.words.indexOf('stack')}');
}
1
likes
160
points
30
downloads

Publisher

verified publishertetr.app

Weekly Downloads

Generate a cryptographically random passphrase from a given in-memory word list.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

collection

More

Packages that depend on passphrase