大佬教程收集整理的这篇文章主要介绍了iphone – 如何在iOS中获取ISBN条形码,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
该应用程序只给我条码9780749423490.
但我需要获得的是ISBN代码0749423498,因为它在我的库的数据库中.有什么办法可以搞定吗?
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
以上是大佬教程为你收集整理的iphone – 如何在iOS中获取ISBN条形码全部内容,希望文章能够帮你解决iphone – 如何在iOS中获取ISBN条形码所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。