Project

upc

0.02
No commit activity in last 3 years
No release in over 3 years
a (very) small library for working with Universal Product Codes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.0
 Project Readme

A small class for generating and validating Universal Product Codes (UPCs), the 12 digit codes found on many older US products. Build Status

Installation

gem install upc

Usage

UPC.new("632737715836").valid?
=> true

UPC.valid?("632737715836")
=> true

UPC.valid?("632737715837")
=> false

UPC.complete("63273771583")
=> "632737715836"

UPC.new("632737715836").to_ean
=> "0632737715836"

Further Reader

Contributing

Source code is publicly available @ http://github.com/yob/upc. Patches welcome, preferably via a git repo I can pull from.