1 package bigsegments 2 3 import ( 4 "crypto/sha256" 5 "encoding/base64" 6 ) 7 8 // HashForContextKey computes the hash that we use in the Big Segment store. This function is exported 9 // for use in LDClient tests. 10 func HashForContextKey(key string) string { 11 hashBytes := sha256.Sum256([]byte(key)) 12 return base64.StdEncoding.EncodeToString(hashBytes[:]) 13 } 14