Skip to content
/ upc Public

Small library for recognising and validating UPC numbers

License

Notifications You must be signed in to change notification settings

yob/upc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Small library for recognising and validating UPC numbers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages