Skip to main content

校验手机设备码

Project description

check-device-code

校验手机设备码

介绍

本库用于校验手机IMEI设备码的最后一位是否正确,如没有最后一位则自动补齐。

使用方法

import check_device_code as cdc

# 输入imei = 14位
print(cdc.check_device_doce('imei',str(86379103507858)))
# 校验失败,自动补齐
{'check': False, 'imei': '863791035078583'}

# 输入imei < 14位
print(cdc.check_device_code('imei',str(8637910350785)))
# 输入imei > 15位
print(cdc.check_device_code('imei',str(8637910350785836)))
# 输入imei != 全数字
print(cdc.check_device_code('imei',str('A63791035078583')))
# 校验失败,返回None
{'check': False, 'imei': None}

# 输入错误的imei
print(cdc.check_device_code('imei',str(863791035078587)))
# 校验失败,返回正确值
{'check': False, 'imei': '863791035078583'}

# 输入正确的imei
print(cdc.check_device_code('imei',str(863791035078583)))
# 校验成功,返回原值
{'check': True, 'imei': '863791035078583'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for check-device-code, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size check_device_code-1.0.1.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page