secstr

package
v12.41.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

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 interface{}) (*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