Coder Social home page Coder Social logo

mixaverros88 / check-digit-iso-6346 Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 557 KB

Java implementation for check digit ISO 6346

Java 54.51% JavaScript 6.59% TypeScript 35.67% HTML 2.94% CSS 0.29%
java iso6346 maven travis wildfly angular jpa rest-api javascript mysql-database docker

check-digit-iso-6346's Introduction

Build Status

Check Digit ISO 6346

This repo in an implementation of the ISO 6346.

What is ISO 6346 (wikipedia definition)

ISO 6346 is an international standard covering the coding, identification and marking of intermodal (shipping) containers used within containerized intermodal freight transport.The standard establishes a visual identification system for every container that includes a unique serial number (with check digit), the owner, a country code, a size, type and equipment category as well as any operational marks. The standard is managed by the International Container Bureau (BIC).

preview image

Step Container number Total
C S Q U 3 0 5 4 3 8
1 13 30 28 32 3 0 5 4 3 8
x x x x x x x x x x
2 1 2 4 8 16 32 64 128 256 512
= = = = = = = = = =
13 60 112 256 48 0 320 512 768 4096
3 Sum all results from (2) 6185
4 Divide (3) by 11 (remainder discarded) 562
5 Multiply (4) by 11 6182
6 (3) minus (5) = Check Digit: 3

Step 1

An equivalent numerical value is assigned to each letter of the alphabet, beginning with 10 for the letter A (11 and multiples thereof are omitted):

0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
A B C D E F G H I J K L M
10 12 13 14 15 16 17 18 19 20 21 23 24
N O P Q R S T U V W X Y Z
25 26 27 28 29 30 31 32 34 35 36 37 38

Step 2

Each of the numbers calculated in step 1 is multiplied by 2position, where position is the exponent to base 2. Position starts at 0, from left to right.

Step 3

Sum up all results of Step above

Step 4

Round the result down towards zero i.e. make the result a whole number (integer)

Step 5

Divide them by 11

Step 6

Multiply the integer value by 11

Step 7

Subtract result of Step 3 from result of (6): This is the check digit.

๐Ÿ’ป Deploy instructions

Use the maven plug-in (wildfly-maven-plugin) for tomcat server in order to automatically deploy this project in your local server. You can find this plug-in in pom.xml file in order to modify with yours configurations, also don't forget to add in settings.xml your credentials for wildfly server.

<servers>
    <server>
        <id>server</id>
        <username>admin</username>
        <password>password</password>
    </server>
</servers>

You can run the below command in order to deploy the artifact in your local tomcat server

mvn clean wildfly:deploy -PnoTests

After the deployment navigate to the following link

API: http://localhost:8080/iso/api/rest
FrontEnd: http://localhost:8080/iso/

Maven Profiles In order to skip tests use this profile

-PnoTests

check-digit-iso-6346's People

Contributors

mixaverros88 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

manosbatsis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.