From a43f1d60b697bf4e6d96f77e24ba8095dc1bd42a Mon Sep 17 00:00:00 2001 From: siddharth Date: Sat, 5 Mar 2022 13:03:53 -0500 Subject: lib: add shaStr --- lib/hash_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/hash_test.go (limited to 'lib/hash_test.go') diff --git a/lib/hash_test.go b/lib/hash_test.go new file mode 100644 index 0000000..bde6b3f --- /dev/null +++ b/lib/hash_test.go @@ -0,0 +1,16 @@ +// Copyright © 2022 siddharth +// SPDX-License-Identifier: ISC + +package lib + +import ( + "testing" +) + +func TestShaShr(t *testing.T) { + s := uint32(256) + sr := shaShr(s, 2) + if sr != s>>2 { + t.Errorf("shaShr test failed") + } +} -- cgit v1.2.3