Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val userId: Long = 12
val deviceUuid: Long = 1234
val carSerialId: Long = 12345
def getHashCode(
userId: Long,
deviceUuid: Long,
carSerialId: Long
): String = {
val userIdPlus: Long = userId + 1
val deviceUuidPlus: Long = deviceUuid + 2
val carSerialIdPlus: Long = carSerialId + 3
s"$userIdPlus-$deviceUuidPlus-$carSerialIdPlus"
}
getHashCode(userId, deviceUuid, carSerialId) // Right Answer = res0: String = 13-1236-12348
getHashCode(deviceUuid, userId, carSerialId) // Wrong Answer = res1: String = 1235-14-12348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.