MCPcopy Create free account
hub / github.com/araddon/qlbridge / MakeId

Function MakeId

datasource/sqlite/conn.go:319–334  ·  view source on GitHub ↗
(dv driver.Value)

Source from the content-addressed store, hash-verified

317}
318
319func 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.
337type Key struct {

Callers 2

LoadTestDataOnceFunction · 0.92
PutMethod · 0.85

Calls

no outgoing calls

Tested by 1

LoadTestDataOnceFunction · 0.74