mod97 0.0.2

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

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

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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.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

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

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

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:mod97/mod97.dart.

Suggestions

  • Package is getting outdated.

    The package was released 70 weeks ago.

  • 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 3 hints.

    Run dartfmt to format lib/mod97.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
Dev dependencies
test >=0.12.0 <0.13.0