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
| class UserRegistrator with Hashing { | |
| def register(username, password) = User(username, password.hash).save | |
| } |
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
| trait Hashing { | |
| @Inject private val hasher: Hasher = null | |
| implicit def stringToHashable(toBeHashed: String) = new { | |
| def hash = hasher.hash(toBeHashed) | |
| } | |
| } |
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
| implicit def stringToHashable(toBeHashed: String) = new { | |
| def hash = hasher.hash(toBeHashed) | |
| } |
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
| implicit def stringToHashable(toBeHashed: String) = new { | |
| def hash = // hashing logic | |
| } |
NewerOlder