Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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 uuid | |
import hashlib | |
def hashText(text): | |
""" | |
Basic hashing function for a text using random unique salt. | |
""" | |
salt = uuid.uuid4().hex | |
return hashlib.sha256(salt.encode() + text.encode()).hexdigest() + ':' + salt | |