From cdac77529a3f7416843b1d455d413c9b0f21cfff Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 29 Mar 2026 10:22:19 +0000 Subject: object/id: Zero is a property of the algorithm --- object/id/algorithm_zero.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 object/id/algorithm_zero.go (limited to 'object/id/algorithm_zero.go') diff --git a/object/id/algorithm_zero.go b/object/id/algorithm_zero.go new file mode 100644 index 00000000..e8c0abf2 --- /dev/null +++ b/object/id/algorithm_zero.go @@ -0,0 +1,11 @@ +package objectid + +// Zero returns the all-zero object ID for this algorithm. +func (algo Algorithm) Zero() ObjectID { + id, err := FromBytes(algo, make([]byte, algo.Size())) + if err != nil { + panic(err) + } + + return id +} -- cgit v1.3.1-10-gc9f91