2023-06-22 22:12:33 +00:00
|
|
|
// Copyright 2022-2023 the Pinniped contributors. All Rights Reserved.
|
2022-05-05 20:12:06 +00:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
package csp
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestHash(t *testing.T) {
|
|
|
|
// Example test vector from https://content-security-policy.com/hash/.
|
|
|
|
require.Equal(t, "sha256-RFWPLDbv2BY+rCkDzsE+0fr8ylGr2R2faWMhq4lfEQc=", Hash("doSomething();"))
|
|
|
|
}
|