...

Source file src/github.com/go-task/slim-sprig/v3/crypto_test.go

Documentation: github.com/go-task/slim-sprig/v3

     1  package sprig
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  var (
     8  	// fastCertKeyAlgos is the list of private key algorithms that are supported for certificate use, and
     9  	// are fast to generate.
    10  	fastCertKeyAlgos = []string{
    11  		"ecdsa",
    12  		"ed25519",
    13  	}
    14  )
    15  
    16  func TestSha256Sum(t *testing.T) {
    17  	tpl := `{{"abc" | sha256sum}}`
    18  	if err := runt(tpl, "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); err != nil {
    19  		t.Error(err)
    20  	}
    21  }
    22  func TestSha1Sum(t *testing.T) {
    23  	tpl := `{{"abc" | sha1sum}}`
    24  	if err := runt(tpl, "a9993e364706816aba3e25717850c26c9cd0d89d"); err != nil {
    25  		t.Error(err)
    26  	}
    27  }
    28  
    29  func TestAdler32Sum(t *testing.T) {
    30  	tpl := `{{"abc" | adler32sum}}`
    31  	if err := runt(tpl, "38600999"); err != nil {
    32  		t.Error(err)
    33  	}
    34  }
    35  

View as plain text