util

package
v0.0.0-...-579b097 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeSHA256

func ComputeSHA256(data []byte) (hash []byte)

ComputeSHA256 returns SHA2-256 on data

func ComputeSHA3256

func ComputeSHA3256(data []byte) (hash []byte)

ComputeSHA3256 returns SHA3-256 on data

func ConcatenateBytes

func ConcatenateBytes(data ...[]byte) []byte

ConcatenateBytes is useful for combining multiple arrays of bytes, especially for signatures or digests over multiple fields This way is more efficient in speed

func CreateUtcTimestamp

func CreateUtcTimestamp() *timestamp.Timestamp

CreateUtcTimestamp returns a google/protobuf/Timestamp in UTC

func ExtractCertificateFromContext

func ExtractCertificateFromContext(ctx context.Context) *x509.Certificate

ExtractCertificateFromContext returns the TLS certificate (if applicable) from the given context of a gRPC stream

func ExtractCertificateHashFromContext

func ExtractCertificateHashFromContext(ctx context.Context) []byte

ExtractCertificateHashFromContext extracts the hash of the certificate from the given context. If the certificate isn't present, nil is returned

func ExtractRawCertificateFromContext

func ExtractRawCertificateFromContext(ctx context.Context) []byte

ExtractRawCertificateFromContext returns the raw TLS certificate (if applicable) from the given context of a gRPC stream

func ExtractRemoteAddress

func ExtractRemoteAddress(ctx context.Context) string

func GenerateBytesUUID

func GenerateBytesUUID() []byte

GenerateBytesUUID returns a UUID based on RFC 4122 returning the generated bytes

func GenerateUUID

func GenerateUUID() string

GenerateUUID returns a UUID based on RFC 4122

func ToChaincodeArgs

func ToChaincodeArgs(args ...string) [][]byte

ToChaincodeArgs converts string args to []byte args

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL