ng-luhn

WebJar for ng-luhn

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

ng-luhn
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

ng-luhn
WebJar for ng-luhn
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/leodido/ng-luhn

Скачать ng-luhn

Имя Файла Размер
ng-luhn-1.0.0.pom
ng-luhn-1.0.0.jar 8 KB
ng-luhn-1.0.0-sources.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/ng-luhn/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>ng-luhn</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/ng-luhn/
implementation 'org.webjars.bower:ng-luhn:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.bower/ng-luhn/
implementation ("org.webjars.bower:ng-luhn:1.0.0")
'org.webjars.bower:ng-luhn:jar:1.0.0'
<dependency org="org.webjars.bower" name="ng-luhn" rev="1.0.0">
  <artifact name="ng-luhn" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='ng-luhn', version='1.0.0')
)
libraryDependencies += "org.webjars.bower" % "ng-luhn" % "1.0.0"
[org.webjars.bower/ng-luhn "1.0.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.bower : angular jar [1.3.0,1.4)

Модули Проекта

Данный проект не имеет модулей.

Luhn algorithm

Bower Travis branch

AngularJS service exposing the fastest implementation of Luhn algorithm.

Usefult to check check credit card numbers validity or generally to verify card numbers generated via this algorithm.

Closurized, less than 500 bytes.

Instructions

The luhn service is a constructor with only a (privileged) method (i.e., check()).

Using it is very simple.

  1. Load AngularJS and this little library

    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
    <script src="https://cdn.rawgit.com/leodido/ng-luhn/master/luhn.min.js"></script>
  2. Declare your AngularJS application with leodido.luhn in the dependencies array

    var app = angular.module('myModule', ['leodido.luhn']);
  3. Inject the service into you AngularJS code and call its check method

    app.controller('NumberController', ['luhn', function(luhn) {
      var isValid = luhn.check('49927398716'); 
    }]);

NOTE

Do not forget to bootstrap your AngularJS application ...

Install

Install it via bower.

bower install ng-luhn

Otherwise you can grab *.luhn.js file/s in the repository root or use rawgit.

References

  • Fastest? Yes, check yourself: jsperf.

Analytics

Версии библиотеки

Версия
1.0.0