Hashing is an important concept, it has numerous applications, and it’s at the core of many other computer science concepts.
HashUtils.kt is a very simple, yet very helpful snippet I’ve used in some of my applications when I need some basic hashing. It’s an extension function, one of Kotlin neat features.
Usage:
val text = "hello" val hashedText = text.hash(Algorithm.SHA256)