Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rusty-ferris-club/mask-text
This is a library to mask text with multiple masking options
https://github.com/rusty-ferris-club/mask-text
Last synced: 2 days ago
JSON representation
This is a library to mask text with multiple masking options
- Host: GitHub
- URL: https://github.com/rusty-ferris-club/mask-text
- Owner: rusty-ferris-club
- License: apache-2.0
- Created: 2022-11-01T19:02:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-01T23:08:05.000Z (about 2 years ago)
- Last Synced: 2024-10-31T11:47:49.672Z (14 days ago)
- Language: Rust
- Size: 32.2 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# mask-text
[![Crates.io](https://img.shields.io/crates/v/mask-text?style=flat-square)](https://crates.io/crates/mask-text)
[![CI](https://github.com/rusty-ferris-club/mask-text/actions/workflows/ci.yaml/badge.svg)](https://github.com/rusty-ferris-club/mask-text/actions/workflows/ci.yaml)This is a library to mask text with multiple masking options
## Usage
```toml
[dependencies]
mask-text = { version = "0.1.2" }
```## Mask Options
* Percentage
* Regex
* Prefix
* All## Examples
```rsfn main() {
// masking 80% of the given text. minimum masking chars should bigger then 3.
let percentage_result = mask_text::Kind::Percentage("text to mask".to_string(), 80, 3, "*".to_string()).mask();// masking text by regex group.
let re = Regex::new("([a-z].*) (mask) ([a-z].*)").unwrap();
let regex_result = mask_text::Kind::Regex("text to mask on group".to_string(), re, 2, "*".to_string()).mask();
// masking 3 first chars from the string.
let prefix_result = mask_text::Kind::Prefix("text to mask".to_string(), 3, "*".to_string()).mask();// masking all chars.
let all_result = mask_text::Kind::All("text to mask".to_string(), "*".to_string()).mask()
}
```[All the examples here](./mask-text/examples/README.md)
## Thanks
To all [Contributors](https://github.com/rusty-ferris-club/mask-text/graphs/contributors) - you make this happen, thanks!## Copyright
Copyright (c) 2022 [@kaplanelad](https://github.com/kaplanelad). See [LICENSE](LICENSE.txt) for further details.