com.deque.networking.utils.DistinctId.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of axe-devtools-android-data Show documentation
Show all versions of axe-devtools-android-data Show documentation
The Axe Devtools Android Data Library
package com.deque.networking.utils
import java.util.UUID
class DistinctId(val userId: String?, val email: String?) {
private val uuid: UUID
init {
val combinedUserIdAndEmail = "${userId}/${email}"
uuid = if (userId.isNullOrEmpty()) {
UUID.randomUUID()
} else {
UUID.nameUUIDFromBytes(combinedUserIdAndEmail.toByteArray())
}
}
override fun toString(): String = uuid.toString()
}