校验手机设备码
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file check_device_code-1.0.1.tar.gz
.
File metadata
- Download URL: check_device_code-1.0.1.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cac5210e233f2b34f3db3fc992533bb6c69690c9b7216822225eed609a8d7bc |
|
MD5 | 49bf86c9ac9cb37bdfeccbde6687b323 |
|
BLAKE2b-256 | 0a7fe1f5762b1738dc1d01e35035b89e98ac4dc4a8d4d7660e583ca89c36746e |