MCPcopy Create free account
hub / github.com/distributedio/titan / newHash

Function newHash

db/hash.go:65–81  ·  view source on GitHub ↗

newHash creates a hash object

(txn *Transaction, key []byte)

Source from the content-addressed store, hash-verified

63
64//newHash creates a hash object
65func newHash(txn *Transaction, key []byte) *Hash {
66 now := Now()
67 return &Hash{
68 txn: txn,
69 key: key,
70 meta: &HashMeta{
71 Object: Object{
72 ID: UUID(),
73 CreatedAt: now,
74 UpdatedAt: now,
75 ExpireAt: 0,
76 Type: ObjectHash,
77 Encoding: ObjectEncodingHT,
78 },
79 },
80 }
81}
82
83//hashItemKey spits field into metakey
84func hashItemKey(key []byte, field []byte) []byte {

Callers 3

Test_newHashFunction · 0.85
setHashMetaFunction · 0.85
GetHashFunction · 0.85

Calls 2

NowFunction · 0.85
UUIDFunction · 0.85

Tested by 2

Test_newHashFunction · 0.68
setHashMetaFunction · 0.68