-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import hashlib | ||
|
||
string = input("Digite a string ou texto a ser gerado a hash: ") | ||
|
||
menu = int(input('''#### MENU - ESCOLHA O TIPO DE HASH | ||
1) MD5 | ||
2) SHA1 | ||
3) SHA256 | ||
4) SHA512 | ||
Digite o número do hash a ser gerado: ''')) | ||
|
||
if menu == 1: | ||
resultado = hashlib.md5(string.encode('utf-8')) | ||
print("A hash MD5 da string", string, "é", resultado.hexdigest()) | ||
elif menu == 2: | ||
resultado = hashlib.sha1(string.encode('utf-8')) | ||
print("A hash SHA1 da string", string, "é", resultado.hexdigest()) | ||
elif menu == 3: | ||
resultado = hashlib.sha256(string.encode('utf-8')) | ||
print("A hash SHA256 da string", string, "é", resultado.hexdigest()) | ||
elif menu == 4: | ||
resultado = hashlib.sha512(string.encode('utf-8')) | ||
print("A hash SHA512 da string", string, "é", resultado.hexdigest()) | ||
else: | ||
print("Algo de errado não está certo") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import itertools | ||
|
||
string = input("String a ser permutada: ") | ||
|
||
resultado = itertools.permutations(string, len(string)) | ||
|
||
for i in resultado: | ||
print(''.join(i)) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from bs4 import BeautifulSoup | ||
import requests | ||
|
||
site = requests.get("https://www.climatempo.com.br/").content | ||
|
||
soup = BeautifulSoup(site, 'html.parser') | ||
|
||
#print(soup.prettify()) | ||
|
||
#temperatura = soup.find("span", class_="_block _margin-b-5 -gray") | ||
|
||
#print(soup.title.string) | ||
|
||
#print(soup.a) | ||
|
||
#print(soup.p.string) | ||
|
||
#print(soup.find('admin')) | ||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import requests | ||
from bs4 import BeautifulSoup | ||
import operator | ||
from collections import Counter | ||
|
||
|
||
def start(url): | ||
wordlist = [] | ||
source_code = requests.get(url).text | ||
|
||
soup = BeautifulSoup(source_code, 'html.parser') | ||
|
||
for each_text in soup.findAll('div', {'class': 'entry-content'}): | ||
content = each_text.text | ||
words = content.lower().split() | ||
for each_word in words: | ||
wordlist.append(each_word) | ||
clean_wordlist(wordlist) | ||
|
||
|
||
def clean_wordlist(wordlist): | ||
clean_list = [] | ||
for word in wordlist: | ||
symbols = '!@#$%^&*()_-+={[}]|\;:"<>?/., ' | ||
for i in range(0, len(symbols)): | ||
word = word.replace(symbols[i], '') | ||
if len(word) > 0: | ||
clean_list.append(word) | ||
create_dictionary(clean_list) | ||
|
||
|
||
def create_dictionary(clean_list): | ||
word_count = {} | ||
|
||
for word in clean_list: | ||
if word in word_count: | ||
word_count[word] += 1 | ||
else: | ||
word_count[word] = 1 | ||
|
||
c = Counter(word_count) | ||
|
||
top = c.most_common(10) | ||
print(top) | ||
|
||
|
||
if __name__ == '__main__': | ||
start("https://www.geeksforgeeks.org/programming-language-choose/") |