feat: build wahrwelt A/D toolkit
This commit is contained in:
1 parent
303438d206
commit
653924d8c6
564 files changed
+36310
-49998
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package rendezvous
|
||||
|
||||
import "math"
|
||||
|
||||
const maxUInt64 = float64(^uint64(0))
|
||||
|
||||
func combineKey(nodeID, value string) string {
|
||||
return nodeID + ":" + value
|
||||
}
|
||||
|
||||
func weightHash(hash uint64, weight int) float64 {
|
||||
scale := 1.0 / -math.Log(float64(hash)/maxUInt64)
|
||||
return scale * float64(weight)
|
||||
}
|
||||
Reference in new issue
Block a user