Coder Social home page Coder Social logo

validator-bic-code's Introduction

OverView

해당 라이브러리는 해상 ISO 6346 (BIC) Codes의 적합성을 판별하는 라이브러리 입니다

Rules

B.I.C (Bureau International des Containers et du Transport Intermodal) 는 다음과 같은 규칙을 가집니다.

  1. 모든 ISO 컨테이너는 11개의 고유한 디지털 코드가 부여된다

  2. 선주 코드(Owner code)

    • 컨테이너 번호 중에서 앞 3자리의 알파벳은 선주 코드를 의미합니다. 이 선주 코드는 BIC(International Container Bureau)에 의해 관리됩니다. BIC로부터 한 번 발급받은 선주 코드는 10년 동안 유지됩니다.
  3. 장비 구분 코드(Equipment category code)

    • 선주 코드 다음이며 앞에서 4번째 자리의 알파벳은 해당 장비의 구분을 위해 만들어진 코드입니다. U는 높이나 너비와 상관없이 컨테이너를 의미합니다. J는 컨테이너와 분리가 가능한 장비를 의미하며 엔진 발전기가 이에 해당합니다. Z는 컨테이너 수송에 필요한 트레일러나 차대(섀시)를 의미합니다.
  4. 일련번호(Serial number)

    • 장비 구분 코드 다음으로 따라오는 6개의 숫자들은 선주가 발행한 일련번호입니다. 이 일련번호의 발행과 각각의 컨테이너에 대한 고유번호의 관리는 선주에게 책임이 존재합니다.
  5. Check digit

    • 컨테이너 번호의 가장 마지막 숫자가 'Check digit'에 해당합니다. 이 숫자는 앞의 컨테이너 번호를 이용하여 공식을 통해 계산하면 구할 수 있습니다. 또한, 이 Check digit을 통해 앞의 컨테이너 번호가 올바른 컨테이너 번호임을 확인하며 컨테이너 번호로서의 효력을 가지게 만들어주는 중요한 역할을 담당합니다.

계산과정

  1. 다음과 같은 매핑 테이블을 이용해 알파벳을 변환합니다

    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
  2. 왼쪽 부터 2의 거듭제곱을 곱해줍니다

    첫번째 두번째 세번째 네번째 다섯번째 여섯번째 일곱번째 여덟번째 아홉번째 열번째
    1 2 4 8 16 32 64 128 256 512
  3. 각각의 값을 모두 합산합니다

  4. 합산한 값을 11로 나눠줍니다

  5. 나눠준값을 내림 처리 합니다

  6. 다시 11을 곱해줍니다

  7. 3 에서 얻은 합산한 값과 11을 곱해준 값의 차를 구합니다

  8. BIC의 CheckDigit(마지막 11자리번째 수) 와 같은지 확인합니다

Reference

rollup declaration BIC - 컨테이너 코드의 의미

validator-bic-code's People

Contributors

sunset-kim avatar

Stargazers

Oddm avatar

Watchers

 avatar

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.