15 Jun
Validating BlackBerry PIN Codes…
A customer misinterpreting the BlackBerry device PIN during checkout is a common occurrence for those processing BlackBerry software purchases. If you are interested in validating BlackBerry PINs on your servers during checkout, the following bit of code (Perl) may be of some use:
 
// — START OF CODE –
my $pin = <get PIN from submitted web page data>
return “Error” if !defined($pin);
$pin = &trimAndUpper($pin);
# Test for length validity.
return “Error” unless length($pin) == 8;
# Test for hex validity.
return “Error” unless ($pin =~ /^[[:xdigit:]]+$/);
# Good PIN at this point.
sub trimAndUpper {
  my ($str) = @_;
  $str =~ s/^\s+//; # left trim
  $str =~ s/\s+$//; # right trim
  $str =~ tr/a-z/A-Z/; # to upper
  return $str;
}
// — END OF CODE –

Posted by fatima on 15.06.08 at 8:46 am
kk…but where would you post this on yur bb?
Posted by Andrey on 15.06.08 at 8:46 am
Fatima.
This is server-side code for validating RIM PIN codes during product checkout. This has nothing to do with the device itself, per-se, and would not need to go onto the device.