Documentation
¶
Overview ¶
Package phonedata 内地手机号归属信息. data file from: https://github.com/ls0f/phone data file format:
| 4 bytes | <- phone.dat 版本号 ------------ | 4 bytes | <- 第一个索引的偏移 ----------------------- | offset - 8 | <- 记录区 ----------------------- | index | <- 索引区 -----------------------
Example ¶
查询一个手机号的归属地信息
package main
import (
"fmt"
"github.com/dingdayu/phonedata"
)
func main() {
info, _ := phonedata.Find("13298181000")
fmt.Println(info)
}
Output: PhoneNum: 13298181000 AreaZone: 0371 CardType: 中国联通 City: 郑州 ZipCode: 450000 Province: 河南
Index ¶
Examples ¶
Constants ¶
View Source
const ( // 归属地标识符 CMCC byte = iota + 0x01 // 中国移动 CUCC // 中国联通 CTCC // 中国电信 CTCCV // 电信虚拟运营商 CUCCV // 联通虚拟运营商 CMCCV // 移动虚拟运营商 IntLen = 4 CharLen = 1 HeadLength = 8 PhoneIndexLength = 9 DataFile = "data/phone.dat" )
Variables ¶
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.