Salted SHA-256 password hash
Compute a salted SHA-256 digest for password storage. Given a `password` and a `salt` (both strings), return the lowercase hex SHA-256 digest of the salt concatenated BEFORE the password (i.e. hash of salt + password), both UTF-8 encoded. Return the 64-character hex string.
Implement
salted_digest(password: str, salt: str) → strExamples
in
["pass","s4lt"]out"e3b5bc3bd05bb8579aa0695bd9606fd5fb7a12fea904bb09fb2ecea441f2c067"What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 12 min
solution.py
InputExpectedGot
["pass","s4lt"]"e3b5bc3bd05bb8579aa0695bd9606fd5fb7a12fea904bb09fb2ecea441f2c067"not run yetsample