secure

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZeroSlice

func ZeroSlice(data []byte)

ZeroSlice 清零一个字节切片

Types

type Bytes

type Bytes struct {
	// contains filtered or unexported fields
}

Bytes 封装敏感字节数据,支持手动清零和 GC 自动清零

func NewBytes

func NewBytes(data []byte) *Bytes

NewBytes 创建安全字节封装,会复制传入的数据

func NewBytesFromString

func NewBytesFromString(s string) *Bytes

NewBytesFromString 从字符串创建安全字节封装

func (*Bytes) Bytes

func (s *Bytes) Bytes() []byte

Bytes 返回底层数据,已清零则返回 nil

func (*Bytes) IsZeroed

func (s *Bytes) IsZeroed() bool

IsZeroed 检查是否已清零

func (*Bytes) String

func (s *Bytes) String() string

String 返回字符串形式,已清零则返回空字符串

func (*Bytes) Zero

func (s *Bytes) Zero()

Zero 清零底层数据

Jump to

Keyboard shortcuts

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