mod97 0.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • --

mod97 #

Calculates the MOD 97 10 of the passed number as specified in ISO7064.

Only positive numbers are allowed.

I have copied this code from iban.js

Usage #

A simple usage example:

import 'package:mod97/mod97.dart';

main() {
  int m = mod97('1234567');
  
  int m2 = mod97('-123', onError: (_) => 5);
  // m2 will be 5
}

The input must be a String. Returned value is an integer.

Invalid characters throw a FormatException unless an onError function is provided.

Changelog #

0.0.1 #

  • Initial version, created by Stagehand

example/mod97_example.dart

import 'package:mod97/mod97.dart';

int main() {
  final hugeNumber = '12345678901234567890';
  int mod = mod97(hugeNumber);
  print('The modulo 97 of $hugeNumber is: $mod');
  return 0;
}

Use this package as a library

1. Depend on it

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


dependencies:
  mod97: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:mod97/mod97.dart';
  
Version Uploaded Documentation Archive
0.1.0 Jan 8, 2019 Go to the documentation of mod97 0.1.0 Download mod97 0.1.0 archive
0.0.2 Feb 13, 2017 Go to the documentation of mod97 0.0.2 Download mod97 0.0.2 archive
0.0.1 Feb 13, 2017 Go to the documentation of mod97 0.0.1 Download mod97 0.0.1 archive
Awaiting analysis to complete.