Skip to content

Instantly share code, notes, and snippets.

@Synesso
Created February 13, 2025 05:09
Show Gist options
  • Save Synesso/2af359b7de460acd5cc13414a23041a3 to your computer and use it in GitHub Desktop.
Save Synesso/2af359b7de460acd5cc13414a23041a3 to your computer and use it in GitHub Desktop.
fun minuteOfDay(token: String) =
MessageDigest.getInstance("SHA-256")
.digest(token.toByteArray())
.fold(0) { acc, byte -> (acc shl 8) or (byte.toInt() and 0xFF) } % 1440
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment