All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.deque.networking.utils.DistinctId.kt Maven / Gradle / Ivy

There is a newer version: 5.5.2
Show newest version
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()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy