Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/noamt/password-masker

A Go library that masks passwords in text
https://github.com/noamt/password-masker

go security

Last synced: 16 days ago
JSON representation

A Go library that masks passwords in text

Awesome Lists containing this project

README

        

= Go Password Masker

image:https://travis-ci.org/noamt/password-masker.svg?branch=master["Build Status", link="https://travis-ci.org/noamt/password-masker"]

A library that helps you mask passwords within strings.

It identifies common password patterns such as:

`password: abcdef123456789`

`pass=abcdef123456789`

and

```
password:
abcdef123456789
```

And replaces them with `\****`:

```
password:
****
```

== Usage

To mask a password within a string:
```
containsPass := "password: nonofyourbusiness"
masked := mask.Password(containsPass)
println(masked) // password: ****
```

You can also select your own mask:
```
containsPass := "password: nonofyourbusiness"
masked := mask.Password(containsPass, "????")
println(masked) // password: ????
```