Skip to content

Commit ec03de6

Browse files
authored
Encode digests as hex strings (#963)
1 parent 7a8e4fc commit ec03de6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

config/config.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ func (config *ItemToItemConfig) Hash() string {
160160
hash.Write([]byte(config.Name))
161161
hash.Write([]byte(config.Type))
162162
hash.Write([]byte(config.Column))
163-
return string(hash.Sum(nil))
163+
164+
digest := hash.Sum(nil)
165+
return hex.EncodeToString(digest[:])
164166
}
165167

166168
type CollaborativeConfig struct {
@@ -313,7 +315,9 @@ func (config *Config) UserNeighborDigest() string {
313315
} else {
314316
hash.Write([]byte("-"))
315317
}
316-
return string(hash.Sum(nil))
318+
319+
digest := hash.Sum(nil)
320+
return hex.EncodeToString(digest[:])
317321
}
318322

319323
func (config *Config) ItemNeighborDigest() string {
@@ -324,7 +328,9 @@ func (config *Config) ItemNeighborDigest() string {
324328
} else {
325329
hash.Write([]byte("-"))
326330
}
327-
return string(hash.Sum(nil))
331+
332+
digest := hash.Sum(nil)
333+
return hex.EncodeToString(digest[:])
328334
}
329335

330336
type digestOptions struct {

0 commit comments

Comments
 (0)