mnid_dart 0.1.5 copy "mnid_dart: ^0.1.5" to clipboard
mnid_dart: ^0.1.5 copied to clipboard

Multi Network Identifier - spec and reference implementation

example/main.dart

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

import 'package:mnid_dart/mnid_dart.dart';

void main() {
  print('enter mnid hash and press ENTER');
  String? mnidAddress =
      stdin.readLineSync(encoding: Encoding.getByName('utf-8')!);
  if (mnidAddress == null) {
    print('enter mnid hash and press ENTER');
    mnidAddress = stdin.readLineSync(encoding: Encoding.getByName('utf-8')!);
  }
  print('isMNID ${MNID.isMNID(mnidAddress!)}');

  final en = MNID.encode(
    network: '0x1',
    address: '0x00521965e7bd230323c423d96c657db5b79d099f',
  );
  print('encode $en');

  print('encode toEqual:  ${en == '2nQtiQG6Cgm1GYTBaaKAgr76uY7iSexUkqX'}');

  final decoderrrr = MNID.decode('34ukSmiK1oA1C5Du8aWpkjFGALoH7nsHeDX');
  print('decoderrrr ${decoderrrr.toString()}');
}
1
likes
140
pub points
37%
popularity

Publisher

verified publisherfuse.io

Multi Network Identifier - spec and reference implementation

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

base_x, collection, hex, sha3

More

Packages that depend on mnid_dart