aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-27 16:14:33 -0500
committerBobby <[email protected]>2022-11-27 16:14:33 -0500
commitb245307f903d8eee53e880c3d68b77ee32d07003 (patch)
tree2153488f311fcc9f34282161380e6cfacd2d8b9f /docs
parent1ed7e8bac832d4f8de8a320d581372038f7011d4 (diff)
downloadedify-b245307f903d8eee53e880c3d68b77ee32d07003.tar.xz
edify-b245307f903d8eee53e880c3d68b77ee32d07003.zip
added ssn and mac validators
Diffstat (limited to 'docs')
-rw-r--r--docs/built-in/index.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/built-in/index.rst b/docs/built-in/index.rst
index d63d4c2..8887b5c 100644
--- a/docs/built-in/index.rst
+++ b/docs/built-in/index.rst
@@ -989,3 +989,33 @@ Here's an example of how to use the ``password`` function:
password("password", min_upper=0, min_digit=0, min_special=0) # returns True
password("pass@#1", min_special=1, special_chars="!", min_digit=0, min_upper=0, min_length=4) # returns False
+ssn(ssn: str)
+-------------
+
+The ``ssn`` function validates a Social Security Number (SSN) string. The function returns ``True`` if the string is a valid SSN, and ``False`` otherwise.
+
+Here's an example of how to use the ``ssn`` function:
+
+.. code-block:: python
+
+ from edify.library import ssn
+
+ ssn('123-45-6789') # returns True
+ ssn('123-45-678') # returns False
+ ssn('123-45-67890') # returns False
+
+
+mac(mac: str)
+-------------
+
+The ``mac`` function validates a MAC address (IEEE 802) string. The function returns ``True`` if the string is a valid MAC address, and ``False`` otherwise.
+
+Here's an example of how to use the ``mac`` function:
+
+.. code-block:: python
+
+ from edify.library import mac
+
+ mac('00:00:00:00:00:00') # returns True
+ mac('00:00:00:00:00:0') # returns False
+ mac('00:00:00:00:00:000') # returns False