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

Function NewHashFromStr

crypto/hash/hash.go:186–193  ·  view source on GitHub ↗

NewHashFromStr creates a Hash from a hash string. The string should be the hexadecimal string of a byte-reversed hash, but any missing characters result in zero padding at the end of the Hash.

(hash string)

Source from the content-addressed store, hash-verified

184// the hexadecimal string of a byte-reversed hash, but any missing characters
185// result in zero padding at the end of the Hash.
186func NewHashFromStr(hash string) (*Hash, error) {
187 ret := new(Hash)
188 err := Decode(ret, hash)
189 if err != nil {
190 return nil, err
191 }
192 return ret, nil
193}
194
195// Decode decodes the byte-reversed hexadecimal string encoding of a Hash to a
196// destination.

Callers 15

TestTxTransferFunction · 0.92
TestBaseAccountFunction · 0.92
TestTxCreateDatabaseFunction · 0.92
getHashMethod · 0.92
DifficultyMethod · 0.92
ToRawNodeIDMethod · 0.92
MarshalBinaryMethod · 0.92
AccountAddressMethod · 0.92
TestFromAccountAndNonceFunction · 0.92
initNodePeersFunction · 0.92
runTransferFunction · 0.92

Calls 1

DecodeFunction · 0.85

Tested by 7

TestTxTransferFunction · 0.74
TestBaseAccountFunction · 0.74
TestTxCreateDatabaseFunction · 0.74
TestFromAccountAndNonceFunction · 0.74
TestHashFunction · 0.68
TestNewHashFromStrFunction · 0.68