mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-07-23 08:22:31 +00:00
44e218194b
Co-authored-by: Ryan Richard <richardry@vmware.com>
20 lines
333 B
Go
20 lines
333 B
Go
// Copyright 2024 the Pinniped contributors. All Rights Reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package stateparam
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"fmt"
|
|
)
|
|
|
|
type Encoded string
|
|
|
|
func (e Encoded) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e Encoded) AuthorizeID() string {
|
|
return fmt.Sprintf("%x", sha256.Sum256([]byte(e)))
|
|
}
|