如何在iOS中获取ISBN条形码

时间:2012-08-04 05:49:11

标签: iphone ios xcode barcode barcode-scanner

我正在做一个关于ISBN条码扫描的项目。我尝试了很多扫描应用程序,但扫描完条码后:enter image description here

应用程序只给了我回条码9780749423490。 但我需要获得的是ISBN代码0749423498,因为它在我的库的数据库中。有没有办法来获得它?

有人可以解释这两个代码之间的区别吗?为什么条形码编号和ISBN条形码编号不同?对于某些书籍是否相同而对某些书籍则不同?谢谢!

3 个答案:

答案 0 :(得分:6)

看起来混淆是“ISBN 10”和“ISBN 13”标准之间的区别。

ISBN Agency网站FAQ说:

"Does the ISBN-13 have any meaning imbedded in the numbers? 
The five parts of an ISBN are as follows:

 1. The current ISBN-13 will be prefixed by "978"
 2. Group or country identifier which identifies a national or geographic grouping of publishers
 3. Publisher identifier which identifies a particular publisher within a group
 4. Title identifier which identifies a particular title or edition of a title
 5. Check digit is the single digit at the end of the ISBN which validates the ISBN"

所以978显然只是填充物。在那之后,接下来的9个数字在两个数字中显然是相同的。两个数字中的最后一位数字是一个校验位,其在ISBN 10和ISBN 13中有所不同。有关详细信息,请参阅this Wikipedia article,但这两个公式为:

对于ISBN 10(最高的一个),所有数字的总和乘以多项式10-9-8-7-6-5-4-3-2-1 mod 11应为0:

0*10 + 7 *9 + 4*8 + 9*7 + 4*6 + 2*5 + 3*4 + 4*3 + 9*2 + 8*1 % 11 == 0

对于ISBN 13(最下面的一个),奇数位的总和* 1加上偶数位* 3的总和应为0.这包括前导978.(这类似于UPC代码为“用户” ......“提到但有点不同,如维基百科文章中所述):

9*1 + 7*3 + 8*1 + 0*3 + 7*1 + 4*3 + 9*1 + 4*3 + 2*1 + 3*3 + 4*1 + 9*3 + 0*1 % 10 == 0

因此,您可以从ISBN 13(底部)代码中获取ISBN 10代码(顶部),如下所示:

isbnBaseCode = <9780749423490 from the 4th to 12th characters>

isbn10CheckDigit = 11 - (isbnBaseCode[0]*10 + isbnBaseCode[1]*9 + ... + isbnBaseCode[8]*2) % 11

isbnCode10 = isbnBaseCode + isbn10CheckDigit

答案 1 :(得分:1)

您的问题的长短之处在于它们实际上都是ISBN。 一种是10位数格式,另一种是13位数字格式。

978 074942349 0
    074942349 8

978是前缀,两者上的最后一位是校验位。 您扫描的项目上的条形码仅代表13位数格式。

根据http://www.isbn.org/standards/home/isbn/transition.asp 您始终可以将从978开始的13位ISBN转换为10位数格式 并提供到在线转换器的链接。它还讨论了979前缀。 我不相信979前缀还在使用,但很高兴知道它们将来可能会被使用。

在图书馆应用空间中工作时,搜索图书馆目录时 项目记录在包含哪些信息方面会有很大差异。 项目记录,特别是关于ISBN,可以包含10位ISBN,13位ISBN,两者或无。因此,要查找项目,您可能需要尝试这两种格式。 我相信,如果您的搜索类型设置为ISBN,某些系统会实际检查提交的ISBN并自动搜索这两种格式。

取决于您尝试做什么。 许多库搜索功能允许使用通配卡,这样可以更容易找到 你要找的东西。例如:

'if the isbn has a length of 13 and starts with 978 
    remove the first 3 (the 978) and last digit (the check digit)
    add a wildcard character to the front and back
    begin search
end if

例如9780749423490将成为* 07494234 * 缺点是它可能会返回多个结果。 即使发生这种情况,它也可能只是一些物品而你的物品 看,如果有,很容易发现。

正如其他人所提供的,维基百科有关ISBN的文章涉及如何在10到13位数字格式之间进行转换的更多技术细节。 http://en.wikipedia.org/wiki/International_Standard_Book_Number

答案 2 :(得分:0)

从978开始的数字是产品代码,特别是UPC(通用产品代码),其中包括ISBN但最后没有校验位。有关生成校验位的代码,请查看ISBN on wikipedia,您将能够从UPC重建ISBN。

相关问题