Skip to content

andrewheberle/redacted-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redacted-string

Go Report Card PkgGoDev

This is a very simple module that can be used to print a string as all '*' characters, although this is configurable.

Install

go get github.com/andrewheberle/redacted-string

Usage

Usage can be as simple as using the Redact call as follows:

fmt.Println(redacted.Redact("a sensitive string"))
// Output: ********

Or you may customise the behaviour as follows:

censor := redacted.New("a sensitive string", redacted.WithCharacter('!'), redacted.WithLength(12))
// Output: !!!!!!!!!!!!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages