secstr

package
v12.120.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Overview

Package secstr provides methods and structs for working with protected (secure) strings

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type String

type String struct {
	Data []byte
}

String contains protected data

func NewSecureString

func NewSecureString(data any) (*String, error)

NewSecureString creates new secure string

Example
passwd := "MySuppaPassword12345"
ss, err := NewSecureString(&passwd)

if err != nil {
	panic(err)
}

fmt.Printf("Password: %s", string(ss.Data))
Output:

func (*String) Destroy

func (s *String) Destroy() error

Destroy destroys data

func (*String) IsEmpty

func (s *String) IsEmpty() bool

IsEmpty returns false if string is empty

Jump to

Keyboard shortcuts

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