MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Short

Method Short

crypto/hash/hash.go:54–63  ·  view source on GitHub ↗

Short returns the hexadecimal string of the first `n` reversed byte(s).

(n int)

Source from the content-addressed store, hash-verified

52
53// Short returns the hexadecimal string of the first `n` reversed byte(s).
54func (h Hash) Short(n int) string {
55 for i := 0; i < HashSize/2; i++ {
56 h[i], h[HashSize-1-i] = h[HashSize-1-i], h[i]
57 }
58 var l = HashSize
59 if n < l {
60 l = n
61 }
62 return hex.EncodeToString(h[:l])
63}
64
65// AsBytes returns internal bytes of hash.
66func (h Hash) AsBytes() []byte {

Callers 15

loadBlocksFunction · 0.80
sprintMethod · 0.80
NewChainWithContextFunction · 0.80
produceBlockMethod · 0.80
processAddTxReqMethod · 0.80
mainCycleMethod · 0.80
applyBlockMethod · 0.80
produceAndStoreBlockMethod · 0.80
blockingFetchBlockMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestHashStringFunction · 0.64