Package-level declarations

Types

Link copied to clipboard
class ByteDataReader(val byteArray: ByteArray)

This class provides methods for reading various data types from a byte array ByteArray.

Link copied to clipboard
object Constants

Various constants used by other classes.

Link copied to clipboard
class Eager<T>(val value: T) : Lazy<T>

Implementation of Lazy for the cases where the value needs to be eagerly created.

Link copied to clipboard
object HexUtil
Link copied to clipboard
object Logger

Logging facility.

Link copied to clipboard
actual object Platform
expect object Platform

Object for selecting platform specific functionality.

actual object Platform
actual object Platform
actual object Platform
Link copied to clipboard
data class UUID(val mostSignificantBits: ULong, val leastSignificantBits: ULong)

Functions

Link copied to clipboard

Computes Andler32 checksum.

Link copied to clipboard
fun ByteStringBuilder.appendByteArray(bArray: ByteArray): ByteStringBuilder

Appends a byte array to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendByteString(bString: ByteString): ByteStringBuilder

Appends a ByteString to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendInt16(value: Int, validRange: IntRange = Int.MIN_VALUE..Int.MAX_VALUE): ByteStringBuilder

Appends a 16-bit signed integer to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendInt16Le(value: Int, validRange: IntRange = Short.MIN_VALUE..Short.MAX_VALUE): ByteStringBuilder

Appends a 16-bit signed integer to this ByteStringBuilder in Little-Endian order.

Link copied to clipboard
fun ByteStringBuilder.appendInt32(value: Int, validRange: IntRange = Int.MIN_VALUE..Int.MAX_VALUE): ByteStringBuilder

Appends a 32-bit signed integer to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendInt32Le(value: Int, validRange: IntRange = Int.MIN_VALUE..Int.MAX_VALUE): ByteStringBuilder

Appends a 32-bit signed integer to this ByteStringBuilder in Little-Endian order.

Link copied to clipboard
fun ByteStringBuilder.appendInt64(value: Long, validRange: LongRange = Long.MIN_VALUE..Long.MAX_VALUE): ByteStringBuilder

Appends a 64-bit signed integer to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendInt64Le(value: Long, validRange: LongRange = Long.MIN_VALUE..Long.MAX_VALUE): ByteStringBuilder

Appends a 64-bit signed integer to this ByteStringBuilder in Little-Endian order.

Link copied to clipboard
fun ByteStringBuilder.appendInt8(value: Byte, validRange: IntRange = Byte.MIN_VALUE..Byte.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendInt8(value: Int, validRange: IntRange = Byte.MIN_VALUE..Byte.MAX_VALUE): ByteStringBuilder

Appends an 8-bit signed integer to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendString(string: String): ByteStringBuilder

Appends a string to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendUInt16(value: Int, validRange: UIntRange = UShort.MIN_VALUE..UShort.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendUInt16(value: UInt, validRange: UIntRange = UShort.MIN_VALUE..UShort.MAX_VALUE): ByteStringBuilder

Appends a 16-bit unsigned integer to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendUInt16Le(value: Int, validRange: UIntRange = UShort.MIN_VALUE..UShort.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendUInt16Le(value: UInt, validRange: UIntRange = UShort.MIN_VALUE..UShort.MAX_VALUE): ByteStringBuilder

Appends a 16-bit unsigned integer to this ByteStringBuilder in Little-Endian order.

Link copied to clipboard
fun ByteStringBuilder.appendUInt32(value: Int, validRange: UIntRange = UInt.MIN_VALUE..UInt.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendUInt32(value: UInt, validRange: UIntRange = UInt.MIN_VALUE..UInt.MAX_VALUE): ByteStringBuilder

Appends a 32-bit unsigned integer to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendUInt32Le(value: Int, validRange: UIntRange = UInt.MIN_VALUE..UInt.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendUInt32Le(value: UInt, validRange: UIntRange = UInt.MIN_VALUE..UInt.MAX_VALUE): ByteStringBuilder

Appends a 32-bit unsigned integer to this ByteStringBuilder in Little-Endian order.

Link copied to clipboard
fun ByteStringBuilder.appendUInt64(value: Long, validRange: ULongRange = ULong.MIN_VALUE..ULong.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendUInt64(value: ULong, validRange: ULongRange = ULong.MIN_VALUE..ULong.MAX_VALUE): ByteStringBuilder

Appends a 64-bit unsigned integer to this ByteStringBuilder.

Link copied to clipboard
fun ByteStringBuilder.appendUInt64Le(value: Long, validRange: ULongRange = ULong.MIN_VALUE..ULong.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendUInt64Le(value: ULong, validRange: ULongRange = ULong.MIN_VALUE..ULong.MAX_VALUE): ByteStringBuilder

Appends a 64-bit unsigned integer to this ByteStringBuilder in Little-Endian order.

Link copied to clipboard
fun ByteStringBuilder.appendUInt8(value: Int, validRange: UIntRange = UByte.MIN_VALUE..UByte.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendUInt8(value: UByte, validRange: UIntRange = UByte.MIN_VALUE..UByte.MAX_VALUE): ByteStringBuilder
fun ByteStringBuilder.appendUInt8(value: UInt, validRange: UIntRange = UByte.MIN_VALUE..UByte.MAX_VALUE): ByteStringBuilder

Appends an 8-bit unsigned integer to this ByteStringBuilder.

Link copied to clipboard
fun ByteString.concat(bStr: ByteString): ByteString

Concatenates this ByteString with another ByteString.

Link copied to clipboard
expect suspend fun ByteArray.deflate(compressionLevel: Int = 5): ByteArray

Compresses data using DEFLATE algorithm according to RFC 1951.

actual suspend fun ByteArray.deflate(compressionLevel: Int): ByteArray
actual suspend fun ByteArray.deflate(compressionLevel: Int): ByteArray
actual suspend fun ByteArray.deflate(compressionLevel: Int): ByteArray
Link copied to clipboard

Extension to decode a ByteArray from a base64 encoded (not URL-safe base64) string as defined in Section 4 of RFC 4648.

Link copied to clipboard

Extension to decode a ByteArray from a URL-safe base64 encoded string as defined in Section 5 of RFC 4648.

Link copied to clipboard

Creates regular expression pattern from simplified glob syntax:

Link copied to clipboard

Extension to decode a ByteArray from a string with hexadecimal numbers.

Link copied to clipboard
fun String.fromHexByteString(): ByteString

Extension to decode a ByteString from a string with hexadecimal numbers.

Link copied to clipboard
fun UUID.Companion.fromJavaUuid(javaUuid: <Error class: unknown class>): UUID
Link copied to clipboard
fun <Error class: unknown class>.fromNSUUID(nsUUID: <Error class: unknown class>): <Error class: unknown class>
Link copied to clipboard

Given a list (X0, X1, X2, ..., Xn, ...) generates a number of lists of the same length where each the list element in the nth position can assume values 0 up to Xn

Link copied to clipboard
fun ByteArray.getByteString(offset: Int, numBytes: Int): ByteString

Extracts a ByteString from a portion of the byte array.

Link copied to clipboard
fun ByteArray.getInt16(offset: Int): Short

Reads an Int16 value from the byte array at the specified offset.

fun ByteString.getInt16(offset: Int): Short

Gets a 16-bit signed integer (Int16) from this ByteString at the specified offset.

Link copied to clipboard

Reads an Int16 value from the byte array at the specified offset in little-endian order.

fun ByteString.getInt16Le(offset: Int): Short

Gets a 16-bit signed integer (Int16) from this ByteString at the specified offset in Little-Endian order.

Link copied to clipboard
fun ByteArray.getInt32(offset: Int): Int

Reads an Int32 value from the byte array at the specified offset.

fun ByteString.getInt32(offset: Int): Int

Gets a 32-bit signed integer (Int32) from this ByteString at the specified offset.

Link copied to clipboard
fun ByteArray.getInt32Le(offset: Int): Int

Reads an Int32 value from the byte array at the specified offset in little-endian order.

fun ByteString.getInt32Le(offset: Int): Int

Gets a 32-bit signed integer (Int32) from this ByteString at the specified offset in Little-Endian order.

Link copied to clipboard
fun ByteArray.getInt64(offset: Int): Long

Reads an Int64 value from the byte array at the specified offset.

fun ByteString.getInt64(offset: Int): Long

Gets a 64-bit signed integer (Int64) from this ByteString at the specified offset.

Link copied to clipboard

Reads an Int64 value from the byte array at the specified offset in little-endian order.

fun ByteString.getInt64Le(offset: Int): Long

Gets a 64-bit signed integer (Int64) from this ByteString at the specified offset in Little-Endian order.

Link copied to clipboard
fun ByteArray.getInt8(offset: Int): Byte

Reads an Int8 value from the byte array at the specified offset.

fun ByteString.getInt8(offset: Int): Byte

Gets an 8-bit signed integer (Int8) from this ByteString at the specified offset.

Link copied to clipboard
Link copied to clipboard
fun ByteArray.getString(offset: Int, numBytes: Int): String

Decodes a portion of the byte array to a String.

Link copied to clipboard
fun <Error class: unknown class>.getSystem(): <Error class: unknown class>
Link copied to clipboard

Reads a UInt16 value from the byte array at the specified offset.

fun ByteString.getUInt16(offset: Int): UShort

Gets a 16-bit unsigned integer (UInt16) from this ByteString at the specified offset.

Link copied to clipboard

Reads a UInt16 value from the byte array at the specified offset in little-endian order.

fun ByteString.getUInt16Le(offset: Int): UShort

Gets a 16-bit unsigned integer (UInt16) from this ByteString at the specified offset in Little-Endian order.

Link copied to clipboard
fun ByteArray.getUInt32(offset: Int): UInt

Reads a UInt32 value from the byte array at the specified offset.

fun ByteString.getUInt32(offset: Int): UInt

Gets a 32-bit unsigned integer (UInt32) from this ByteString at the specified offset.

Link copied to clipboard

Reads a UInt32 value from the byte array at the specified offset in little-endian order.

fun ByteString.getUInt32Le(offset: Int): UInt

Gets a 32-bit unsigned integer (UInt32) from this ByteString at the specified offset in Little-Endian order.

Link copied to clipboard

Reads a UInt64 value from the byte array at the specified offset.

fun ByteString.getUInt64(offset: Int): ULong

Gets a 64-bit unsigned integer (UInt64) from this ByteString at the specified offset.

Link copied to clipboard

Reads a UInt64 value from the byte array at the specified offset in little-endian order.

fun ByteString.getUInt64Le(offset: Int): ULong

Gets a 64-bit unsigned integer (UInt64) from this ByteString at the specified offset in Little-Endian order.

Link copied to clipboard
fun ByteArray.getUInt8(offset: Int): UByte

Reads a UInt8 value from the byte array at the specified offset.

fun ByteString.getUInt8(offset: Int): UByte

Gets an 8-bit unsigned integer (UInt8) from this ByteString at the specified offset.

Link copied to clipboard
Link copied to clipboard
expect suspend fun ByteArray.inflate(): ByteArray

Decompresses data compressed DEFLATE algorithm according to RFC 1951.

actual suspend fun ByteArray.inflate(): ByteArray
actual suspend fun ByteArray.inflate(): ByteArray
actual suspend fun ByteArray.inflate(): ByteArray
Link copied to clipboard
Link copied to clipboard
fun ByteArray.putInt16(offset: Int, value: Int, validRange: IntRange = Short.MIN_VALUE..Short.MAX_VALUE)

Writes an Int16 value to the byte array at the specified offset.

Link copied to clipboard
fun ByteArray.putInt16Le(offset: Int, value: Int, validRange: IntRange = Short.MIN_VALUE..Short.MAX_VALUE)

Writes an Int16 value to the byte array at the specified offset in little-endian order.

Link copied to clipboard
fun ByteArray.putInt32(offset: Int, value: Int, validRange: IntRange = Int.MIN_VALUE..Int.MAX_VALUE)

Writes an Int32 value to the byte array at the specified offset.

Link copied to clipboard
fun ByteArray.putInt32Le(offset: Int, value: Int, validRange: IntRange = Int.MIN_VALUE..Int.MAX_VALUE)

Writes an Int32 value to the byte array at the specified offset in little-endian order.

Link copied to clipboard
fun ByteArray.putInt64(offset: Int, value: Long, validRange: LongRange = Long.MIN_VALUE..Long.MAX_VALUE)

Writes an Int64 value to the byte array at the specified offset.

Link copied to clipboard
fun ByteArray.putInt64Le(offset: Int, value: Long, validRange: LongRange = Long.MIN_VALUE..Long.MAX_VALUE)

Writes an Int64 value to the byte array at the specified offset in little-endian order.

Link copied to clipboard
fun ByteArray.putInt8(offset: Int, value: Int, validRange: IntRange = Byte.MIN_VALUE..Byte.MAX_VALUE)

Writes an Int8 value to the byte array at the specified offset.

Link copied to clipboard
fun ByteArray.putUInt16(offset: Int, value: UInt, validRange: UIntRange = UShort.MIN_VALUE.toUInt()..UShort.MAX_VALUE.toUInt())

Writes a UInt16 value to the byte array at the specified offset.

Link copied to clipboard
fun ByteArray.putUInt16Le(offset: Int, value: UInt, validRange: UIntRange = UShort.MIN_VALUE.toUInt()..UShort.MAX_VALUE.toUInt())

Writes a UInt16 value to the byte array at the specified offset in little-endian order.

Link copied to clipboard
fun ByteArray.putUInt32(offset: Int, value: UInt, validRange: UIntRange = UInt.MIN_VALUE..UInt.MAX_VALUE)

Writes a UInt32 value to the byte array at the specified offset.

Link copied to clipboard
fun ByteArray.putUInt32Le(offset: Int, value: UInt, validRange: UIntRange = UInt.MIN_VALUE..UInt.MAX_VALUE)

Writes a UInt32 value to the byte array at the specified offset in little-endian order.

Link copied to clipboard
fun ByteArray.putUInt64(offset: Int, value: ULong, validRange: ULongRange = ULong.MIN_VALUE..ULong.MAX_VALUE)

Writes a UInt64 value to the byte array at the specified offset.

Link copied to clipboard
fun ByteArray.putUInt64Le(offset: Int, value: ULong, validRange: ULongRange = ULong.MIN_VALUE..ULong.MAX_VALUE)

Writes a UInt64 value to the byte array at the specified offset in little-endian order.

Link copied to clipboard
fun ByteArray.putUInt8(offset: Int, value: UInt, validRange: UIntRange = UByte.MIN_VALUE.toUInt()..UByte.MAX_VALUE.toUInt())

Writes a UInt8 value to the byte array at the specified offset.

Link copied to clipboard

Extension to encode a ByteArray to a base64 encoding (not URL-safe base64) without padding as defined in Section 4 of RFC 4648.

Link copied to clipboard

Extension to encode a ByteArray to a URL-safe base64 encoding without padding as defined in Section 5 of RFC 4648.

Link copied to clipboard
fun ByteArray.toBufferSource(): <Error class: unknown class>

Converts to a BufferSource

Link copied to clipboard
fun <Error class: unknown class>.toByteArray(): ByteArray
Link copied to clipboard
fun ByteArray.toHex(upperCase: Boolean = false, byteDivider: String = "", decodeAsString: Boolean = false): String

Extension to encode a ByteArray to a string with hexadecimal numbers.

fun ByteString.toHex(upperCase: Boolean = false, byteDivider: String = "", decodeAsString: Boolean = false): String
Link copied to clipboard
fun UUID.toJavaUuid(): <Error class: unknown class>
Link copied to clipboard
fun <Error class: unknown class>.toKotlinError(): <Error class: unknown class>
Link copied to clipboard
fun <Error class: unknown class>.toKotlinInstant(): <Error class: unknown class>
Link copied to clipboard
fun ByteArray.toNSData(): <Error class: unknown class>
Link copied to clipboard
fun <Error class: unknown class>.toNSUUID(): <Error class: unknown class>
Link copied to clipboard

Returns a new Instant with the fractional part of seconds removed.

Link copied to clipboard

Convert the Serial number represented as a big endian byte array form base256 unsigned integer to the requested base (Base-10 by default) unsigned integer number. Required to display very long serial numbers discovered in some certificates as a numeric string value in the UI.

Link copied to clipboard
suspend fun validateAndroidKeyAttestation(chain: X509CertChain, challenge: ByteString?, requireGmsAttestation: Boolean, requireVerifiedBootGreen: Boolean, requireKeyMintSecurityLevel: AndroidKeystoreSecurityLevel, requireAppSignatureCertificateDigests: Set<ByteString>, requireAppPackages: Set<String>)
Link copied to clipboard
suspend fun validateCloudKeyAttestation(chain: X509CertChain, nonce: ByteString, trustedRootKeys: Set<ByteString>)
Link copied to clipboard
suspend fun ByteArray.zlibDeflate(compressionLevel: Int = 9): ByteArray

Compresses data using DEFLATE algorithm according to RFC 1951 with zlib wrapper RFC 1950.

Link copied to clipboard

Decompresses data compressed DEFLATE algorithm according to RFC 1951 with zlib wrapper RFC 1950.