ShortIDToNum string to num
(code string)
| 51 | |
| 52 | // ShortIDToNum string to num |
| 53 | func ShortIDToNum(code string) int64 { |
| 54 | if len(code) < 2 { |
| 55 | return 0 |
| 56 | } |
| 57 | scodeType := code[0:2] |
| 58 | code = code[2:int32(len(code))] |
| 59 | |
| 60 | id := utils.DeShortID(code, salt) |
| 61 | codeType := utils.DeShortID(scodeType, salt) |
| 62 | return 10000000000000000 + codeType*10000000000000 + id |
| 63 | } |
| 64 | |
| 65 | func EnShortID(id string) string { |
| 66 | num, err := strconv.ParseInt(id, 10, 64) |