0

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

Znik
  • 1,047
  • 12
  • 17

1 Answers1

1

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 ! :-)

MrLo
  • 182
  • 3
  • nice code. unfortunately I have 12 character SNses, and this have got mix of numbers [0-9] and latin characters [A-Z] with unimportant size. Then I'm still waiting for another recipe, but this one is very usefull. – Znik Jul 14 '14 at 09:30