aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorBastien Orivel2017-09-26 12:46:37 +0200
committerBastien Orivel2017-09-27 16:00:59 +0200
commitf50f890bb1d41449e22fc06dedf5594ab7ddc2e4 (patch)
tree02655c187c63de905658944e089a250acb5c130d /README.md
parent4d7138e040cd5faaf84448a75b64f3ff0e4673e5 (diff)
downloadvalidator-f50f890bb1d41449e22fc06dedf5594ab7ddc2e4.tar.bz2
Add a credit card number validator
Instead of using our own algorithm, I chose to use rs-card-validator.
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index 3a8aa0c..bbbe4de 100644
--- a/README.md
+++ b/README.md
@@ -151,6 +151,16 @@ Examples:
#[validate(regex = "ALLOWED_USERNAMES_RE"))]
```
+### credit\_card
+Test whetever the string is a valid credit card number. To use this validator,
+you must enable the `credit_cards` feature for the `validator` crate.
+
+Examples:
+
+```rust
+#[validate(credit_card)]
+```
+
### custom
Calls one of your function to do a custom validation.
The field will be given as parameter and it should return a `Option<String>` representing the error code,