This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
# Importing Libraries | |
from pymongo import MongoClient | |
from datetime import datetime | |
# NOTE: make sure to install pymongo[srv] too via "pip install pymongo[srv]" | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
# Database Configuration | |
Cluster = MongoClient("mongodb+srv://<username>:<password>@<clustor>.<hostname>/<database-name>") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import urllib.parse | |
def send_sms_with_raygansms_via_get_method(phone_number, message): | |
try: | |
url = 'https://raygansms.com/SendMessageWithUrl.ashx?' | |
parametrs = { | |
'UserName': '<username>', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import from library | |
from hashlib import sha256 | |
# same for all users | |
public_extra = 'Some random string' | |
# function | |
def password_hash_generator(password, private_extra): | |
# private_extra is different for every user | |
hash_of_password = sha256((password + private_extra + public_extra).encode('utf-8')).hexdigest() |