分析某手机号码归属地储存结构

逛v2ex的时候看到个手机号码归属地的开源项目,因而便剖析了一下他的数据文件构造,与纯粹IP数据库的构造无异。

lovedboy/phone

phone.dat

+------------------------------------+
| version(4 char) | start index(int) |
+------------------------------------+
                            |
                            v
                  +------------------------------------------------+
                  | phone(int) | record offset(int) | corp(1 char) |
                  +------------------------------------------------+
                                          |
                                          v
                  +------------------------------------------------+
                  | record detail                                  |
                  +------------------------------------------------+