Package-level declarations

Functions

Link copied to clipboard
fun crc32(bytes: ByteArray): Long

Computes the CRC-32 checksum of the given bytes.

Link copied to clipboard

Computes the CRC-32 checksum of this string encoded as UTF-8.

Link copied to clipboard

Decodes this string using the standard base64 alphabet of RFC 4648 section 4.

Link copied to clipboard

Decodes this string using the url-safe base64 alphabet of RFC 4648 section 5.

Link copied to clipboard

Decodes this hexadecimal string into a byte array.

Link copied to clipboard

Returns whether this array ends with the given suffix.

Link copied to clipboard
fun fnv1a32(bytes: ByteArray): Int

Computes the 32-bit FNV-1a hash of the given bytes.

Link copied to clipboard

Computes the 32-bit FNV-1a hash of this string encoded as UTF-8.

Link copied to clipboard
fun fnv1a64(bytes: ByteArray): Long

Computes the 64-bit FNV-1a hash of the given bytes.

Link copied to clipboard

Computes the 64-bit FNV-1a hash of this string encoded as UTF-8.

Link copied to clipboard
fun ByteArray.indexOf(sub: ByteArray, fromIndex: Int = 0): Int

Returns the index of the first occurrence of the given byte sequence at or after fromIndex.

Link copied to clipboard

Reads a 64-bit IEEE 754 double in big-endian order starting at offset.

Link copied to clipboard

Reads a 64-bit IEEE 754 double in little-endian order starting at offset.

Link copied to clipboard

Reads a 32-bit IEEE 754 float in big-endian order starting at offset.

Link copied to clipboard

Reads a 32-bit IEEE 754 float in little-endian order starting at offset.

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

Reads a 32-bit signed integer in big-endian order starting at offset.

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

Reads a 32-bit signed integer in little-endian order starting at offset.

Link copied to clipboard

Reads a 64-bit signed integer in big-endian order starting at offset.

Link copied to clipboard

Reads a 64-bit signed integer in little-endian order starting at offset.

Link copied to clipboard

Reads a 16-bit signed integer in big-endian order starting at offset.

Link copied to clipboard

Reads a 16-bit signed integer in little-endian order starting at offset.

Link copied to clipboard

Returns whether this array begins with the given prefix.

Link copied to clipboard

Encodes this byte array using the standard base64 alphabet of RFC 4648 section 4.

Link copied to clipboard

Encodes this byte array using the url-safe base64 alphabet of RFC 4648 section 5.

Link copied to clipboard

Returns this double as a new 8-byte array in big-endian order.

Returns this float as a new 4-byte array in big-endian order.

Returns this 32-bit value as a new 4-byte array in big-endian order.

Returns this 64-bit value as a new 8-byte array in big-endian order.

Returns this 16-bit value as a new 2-byte array in big-endian order.

Link copied to clipboard

Returns this double as a new 8-byte array in little-endian order.

Returns this float as a new 4-byte array in little-endian order.

Returns this 32-bit value as a new 4-byte array in little-endian order.

Returns this 64-bit value as a new 8-byte array in little-endian order.

Returns this 16-bit value as a new 2-byte array in little-endian order.

Link copied to clipboard
fun ByteArray.toHex(upperCase: Boolean = false): String

Encodes this byte array as a hexadecimal string.

Link copied to clipboard
fun ByteArray.writeDoubleBe(offset: Int, value: Double)

Writes a 64-bit IEEE 754 double in big-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeDoubleLe(offset: Int, value: Double)

Writes a 64-bit IEEE 754 double in little-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeFloatBe(offset: Int, value: Float)

Writes a 32-bit IEEE 754 float in big-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeFloatLe(offset: Int, value: Float)

Writes a 32-bit IEEE 754 float in little-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeIntBe(offset: Int, value: Int)

Writes a 32-bit signed integer in big-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeIntLe(offset: Int, value: Int)

Writes a 32-bit signed integer in little-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeLongBe(offset: Int, value: Long)

Writes a 64-bit signed integer in big-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeLongLe(offset: Int, value: Long)

Writes a 64-bit signed integer in little-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeShortBe(offset: Int, value: Short)

Writes a 16-bit signed integer in big-endian order starting at offset.

Link copied to clipboard
fun ByteArray.writeShortLe(offset: Int, value: Short)

Writes a 16-bit signed integer in little-endian order starting at offset.

Link copied to clipboard

Returns a new array where every byte is xor-combined with the repeating key.