Parsing of GS1-128 (formerly UCC/EAN-128) element strings - the Application Identifier (AI) encoding used on logistics and retail barcodes.
parse accepts either the human-readable parenthesized form or the raw scanned
form (variable-length fields terminated by FNC1 / ASCII group-separator 0x1D),
and returns a vector of segment maps in order:
(parse "(01)09521234543213(15)170331(10)ABC123")
;=> [{:ai "01" :label "GTIN" :value "09521234543213"}
; {:ai "15" :label "BEST BEFORE" :value "170331"}
; {:ai "10" :label "BATCH/LOT" :value "ABC123"}]
Weight/measure and amount AIs carry an implied decimal place (the AI's last
digit); those segments also report :decimals and a numeric :decimal-value.
Parsing of GS1-128 (formerly UCC/EAN-128) element strings - the Application
Identifier (AI) encoding used on logistics and retail barcodes.
`parse` accepts either the human-readable parenthesized form or the raw scanned
form (variable-length fields terminated by FNC1 / ASCII group-separator 0x1D),
and returns a vector of segment maps in order:
(parse "(01)09521234543213(15)170331(10)ABC123")
;=> [{:ai "01" :label "GTIN" :value "09521234543213"}
; {:ai "15" :label "BEST BEFORE" :value "170331"}
; {:ai "10" :label "BATCH/LOT" :value "ABC123"}]
Weight/measure and amount AIs carry an implied decimal place (the AI's last
digit); those segments also report `:decimals` and a numeric `:decimal-value`.(parse s)Parse a GS1-128 element string (parenthesized or raw/FNC1 form) into an ordered
vector of {:ai :label :value (:decimals :decimal-value)} segments.
Parse a GS1-128 element string (parenthesized or raw/FNC1 form) into an ordered
vector of `{:ai :label :value (:decimals :decimal-value)}` segments.(parse-map s)Like parse, but returns a map of AI string -> value (last wins on repeats).
Like `parse`, but returns a map of AI string -> value (last wins on repeats).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |