8000
Skip to content

chamorin/bip39-dart

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BIP39

Build Status

Dart implementation of Bitcoin BIP39: Mnemonic code for generating deterministic keys

Usage

A simple usage example:

import 'package:bip39/bip39.dart' as bip39;

main() {
  // Generate a random mnemonic (uses Random.secure() under the hood), defaults to 128-bits of entropy
  var mnemonic = await bip39.generateMnemonic();
  // => 'alarm boost mom torch couple owner myself gift sugar tell ticket panther'
  
  bip39.mnemonicToSeedHex('basket actual');
  // => '5cf2d4a8b0355e90295bdfc565a022a409af063d5365bb57bf74d9528f494bfa4400f53d8349b80fdae44082d7f9541e1dba2b003bcfec9d0d53781ca676651f'
  
  bip39.mnemonicToSeed('basket actual');
  // => [92, 242, 212, 168, 176, 53, 94, 144, 41, 91, 223, 197, 101, 160, 34, 164, 9, 175, 6, 61, 83, 101, 187, 87, 191, 116, 217, 82, 143, 73, 75, 250, 68, 0, 245, 61, 131, 73, 184, 15, 218, 228, 64, 130, 215, 249, 84, 30, 29, 186, 43, 0, 59, 207, 236, 157, 13, 83, 120, 28, 166, 118, 101, 31]
  
  await bip39.validateMnemonic(mnemonic);
  // => true
  
  await bip39.validateMnemonic('basket actual');
  // => false
  
  
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

About

BIP39 mnemonic code implementation in Dart lang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Dart 100.0%
0