Utils

object Utils

Functions

Link copied to clipboard
fun decode(uuid: String): UUID

Formats a UUID string to a standard UUID format.

Link copied to clipboard
fun encode(uuid: UUID): String

Drops the dashes in the UUID.

Link copied to clipboard

Converts a UUID to a byte array.

Converts a UByte to a byte array.

Converts an Int to a byte array using the Big Endian representation.

Converts a UShort to a byte array.

fun UInt.toByteArray(data: Number, size: Int = 4): ByteArray
Link copied to clipboard

Converts a 4-byte array to an Int.

fun ByteArray.toInt(offset: Int): Int

Returns an Int from a byte array with a given offset.

Link copied to clipboard

Converts a 2-byte array to a Short.

Link copied to clipboard

Returns an Int from a byte array with a given offset.

Link copied to clipboard

Converts a byte array to a UUID.