MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / toHexString

Function toHexString

hashing/sha1/sha1_test.go:13–15  ·  view source on GitHub ↗

Helper function to convert hash output to hex string for comparison

(hash [20]byte)

Source from the content-addressed store, hash-verified

11
12// Helper function to convert hash output to hex string for comparison
13func toHexString(hash [20]byte) string {
14 return hex.EncodeToString(hash[:])
15}
16
17// Test vectors for SHA-1 (from RFC 3174 and other known sources)
18var tests = []struct {

Callers 1

TestHashFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected