(dv driver.Value)
| 317 | } |
| 318 | |
| 319 | func MakeId(dv driver.Value) uint64 { |
| 320 | switch vt := dv.(type) { |
| 321 | case int: |
| 322 | return uint64(vt) |
| 323 | case int64: |
| 324 | return uint64(vt) |
| 325 | case []byte: |
| 326 | return siphash.Hash(456729, 1111581582, vt) |
| 327 | case string: |
| 328 | return siphash.Hash(456729, 1111581582, []byte(vt)) |
| 329 | //by := append(make([]byte,0,8), byte(r), byte(r>>8), byte(r>>16), byte(r>>24), byte(r>>32), byte(r>>40), byte(r>>48), byte(r>>56)) |
| 330 | case datasource.KeyCol: |
| 331 | return MakeId(vt.Val) |
| 332 | } |
| 333 | return 0 |
| 334 | } |
| 335 | |
| 336 | // Key implements Key and Sort interfaces. |
| 337 | type Key struct { |
no outgoing calls