test: add example for cryptor package new functions

This commit is contained in:
dudaodong committed 2023-07-25 10:18:54 +08:00
1 parent 989b4dd791
commit 0456b65cc7
2 files changed
+86 -4

No files matched your search

+12
View File
@@ -77,6 +77,18 @@ func TestHmacSha1(t *testing.T) {
assert.Equal(expected, hmacSha1)
}
func TestHmacSha1WithBase64(t *testing.T) {
t.Parallel()
s := "hello"
key := "12345"
hmacSha1 := HmacSha1WithBase64(s, key)
expected := "XGqdsMzLkuNu0DI/0Jt/k23prOA="
assert := internal.NewAssert(t, "TestHmacSha1")
assert.Equal(expected, hmacSha1)
}
func TestHmacSha256(t *testing.T) {
t.Parallel()