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
import os | |
import hashlib | |
salt = os.urandom(32) | |
plaintext = 'hellow0rld'.encode() | |
digest = hashlib.pbkdf2_hmac('sha256', plaintext, salt, 10000) | |
hex_hash = digest.hex() | |
print(hex_hash) |
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
username | password_hash | |
---|---|---|
th0mas808 | 1455bc3fa6b863bf15b4dbd2eece56ed1f199130490297f6647135a9aebb534d | |
pl3th0ra | 4d416367f3f96a2c6053bf1622f9741f20519f9f7280a6b459318350820a83f9 | |
tiPsy | 2e3777b9010d07ed87a909cf7cef956923c8daf35cfcb8cca6da0ac60bddb4dd | |
GaryVee | 60b170c29d53ab11dc6a153dde5084de16e95062928e740e1f2d3e787fedc178 | |
Harry3080 | 169292d2966a24eb01d2002d378de26c9a5a85b2e27b49ebdb63583a114ff5f8 |
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
import hashlib | |
plaintext = "hello".encode() | |
# instantiate sha3_256 object | |
d = hashlib.sha3_256(plaintext) | |
# generate binary bash of "hello" string | |
hash = d.digest() | |
print(hash) |
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
import hashlib | |
plaintext = "hello".encode() | |
d = hashlib.sha256(plaintext) | |
# generate binary hash of "hello" string | |
hash = d.digest() | |
print(hash) | |
# generate human readable hash of "hello" string |
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
name | gender | age | phone_number | |
---|---|---|---|---|
Donetta Brody | Female | 24 | (770) 936-5965 | |
Otis Revell | Male | 52 | (202) 911-3723 | |
Retha Cottingham | Female | 24 | (299) 505-4199 | |
Tawanda Sandridge | Female | 22 | (488) 466-4899 | |
Ila Shingleton | Male | 24 | (391) 304-8813 | |
Latina Mateer | Female | 33 | (484) 726-1158 | |
Jerrold Villeda | Male | 32 | NULL | |
Jean Gruner | Female | 60 | NULL | |
Kecia Bollman | Female | 43 | NULL |
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
name | gender | age | phone_number | |
---|---|---|---|---|
Donetta Brody | Female | 24 | (770) 936-5965 | |
Otis Revell | Male | 52 | (202) 911-3723 | |
Retha Cottingham | Female | 24 | (299) 505-4199 | |
Tawanda Sandridge | Female | 22 | (488) 466-4899 | |
Ila Shingleton | Male | 24 | (391) 304-8813 | |
Latina Mateer | Female | 33 | (484) 726-1158 |
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
Donetta Brody | Female | 24 | (770) 936-5965 | |
---|---|---|---|---|
Otis Revell | Male | 52 | (202) 911-3723 | |
Retha Cottingham | Female | 24 | (299) 505-4199 | |
Tawanda Sandridge | Female | 22 | (488) 466-4899 | |
Ila Shingleton | Male | 24 | (391) 304-8813 | |
Latina Mateer | Female | 33 | (484) 726-1158 | |
Jerrold Villeda | Male | 32 | NULL | |
Jean Gruner | Female | 60 | NULL | |
Kecia Bollman | Female | 43 | NULL |
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
--- seed person table with sample data from person.csv | |
COPY person(id, name, gender, age) | |
FROM '/path/to/person.csv' | |
DELIMITER ',' | |
CSV HEADER; | |
--- seed contact table with sample data from contact.csv | |
COPY contact(id, phone_number, street_address, person_id) | |
FROM '/path/to/contact.csv' | |
DELIMITER ',' |
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
CREATE TABLE contact( | |
id SERIAL PRIMARY KEY, | |
phone_number VARCHAR, | |
street_address VARCHAR, | |
person_id INTEGER, | |
CONSTRAINT fk_person | |
FOREIGN KEY(person_id) | |
REFERENCES contact(id) | |
) |
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
CREATE TABLE person( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR, | |
gender VARCHAR, | |
age INTEGER | |
) |