Znik
Znik

Reputation: 1146

First check for iPad serial number is correct

I must administrate a lot of iPads. There are a lot of new serial numbers. I rewrite serials from ipad to my web application.

Is there any algorithm for checking i rewrited serial number correctly? enough is the idea how calculate this, or implementation in any language

Upvotes: 0

Views: 477

Answers (1)

MrLo
MrLo

Reputation: 182

You have to validate the serial by using regex i think, here is an example with jquery :

var regex = /(\d{3})([12]\d{3})([01][1-9])(\d{5})/,
     input = '25020130612345';

 if (input.match(regex)) {
     //Input is correct :-)
 }else{
     //Input is wrong :-(
 }

You just have to find your own regex (http://geekswithblogs.net/brcraju/archive/2003/10/23/235.aspx)

Good luck ! :-)

Upvotes: 1

Related Questions