A Clojure/ClojureScript library designed to generate USPS Intelligent Mail Barcodes. The core functionality is in imbarcode.core/encode. Given the necessary parameters, this will output a string representing the extenders in the computed barcode.
See https://ribbs.usps.gov/onecodesolution for a complete specification of USPS Intelligent Mail Barcodes, a font file to properly display your encoded barcode, and other useful resources.
The library is available as a Maven artifact from Clojars.
The top-level encoding functionality is provided in the
imbarcode.core
namespace.
Require it in the REPL:
(require '[imbarcode.core :as imb])
Require it in your application:
(ns my-app.core
(:require [imbarcode.core :as imb]))
user=> ; Destination tracing
user=> (imb/encode imb/barcode-id:default imb/service-type-id:destination "123456789" "123456" "123456789")
"ADFFDTDATDTDDDTTDTTFTFFAFTATFATATDATDDDDDFDAFAFFATTADDTATDDDAFFFA"
user=> ; Origin tracing
user=> (imb/encode imb/barcode-id:default imb/service-type-id:origin "999888777666555" "012345678")
"FAADADDDTAFTAFDFFTDAADADTAFTTDATAAFTAFTTFAATAAFTFATDTFATFFTATTAAF"
See resources/public/dev-index.html
and resources/public/index.html
for examples
of usage in ClojureScript
To run all the tests (Clojure and ClojureScript):
lein test
To run just the Clojure tests:
lein clj-test
To run just the ClojureScript tests:
lein cljs-test
Copyright (C) 2014-2016 Democracy Works, Inc.
Distributed under the Eclipse Public License, the same as Clojure.