Author image Adam Wohld
and 1 contributors

NAME

Data::ESN - Manipulate mobile ESN values

VERSION

Version 0.04

SYNOPSIS

Quick summary of what the module does.

Perhaps a little code snippet.

    use Data::ESN qw( esn_to_hex esn_to_dec esn_valid esn_is_hex esn_is_dec );

    my $esn_hex = '2df812ca';

    #  if we have a Hex ESN, convert it to Decimal
    my $esn_dec = esn_to_dec( $esn_hex ) if esn_is_hex( $esn_hex );

    #  if we have a Decimal ESN, convert it to Hex
    $esn_hex = esn_to_hex( $esn_dec ) if esn_is_dec( $esn_dec );

    print "valid esn found" if esn_valid( $esn_hex );

    #  print if we have a 'dec' or 'hex' ESN
    print "our ESN is a " . esn_valid( $esn_hex ) . " esn.";
    

EXPORT

    esn_to_hex
    esn_to_dec
    esn_valid
    esn_is_hex
    esn_is_dec

SUBROUTINES/METHODS

esn_to_hex

Converts a Decimal ESN to Hex. If an invalid ESN is used, it will throw a warning and return to 0.

esn_to_dec

Convert a Hex ESN to Decimal. If an invalid Hex ESN is used, it will throw a warning and return 0.

esn_valid

Check to see if the ESN looks like a valid ESN, either Decimal or Hex. If it looks like a Decimal ESN, it returns "dec". If it looks like a Hex ESN it returns "hex". If it doesn't match either it returns 0

esn_is_hex

If ESN appears to be Hex, return 1, else return 0. A valid Hex ESN is 8 digits in length, 00000000 to FFFFFFFF inclusive.

esn_is_dec

If ESN appears to be Decimal, return 1, else return 0. A valid Decimal ESN is 11 digits in length, with the first three digits between 0 and 255 inclusive and the last 8 digits between 00000000 and 16777215 inclusive.

AUTHOR

Adam Wohld, <adam at spatialsystems.org>

BUGS

Please report any bugs or feature requests to bug-data-esn at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-ESN. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Data::ESN

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2012 Adam Wohld.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.