BinarySize

Represents a binary size as a number of bits, with conversions to bytes.

Used throughout the API for key sizes, tag sizes, IV sizes, salt sizes, etc. Values must be non-negative and a multiple of 8 (byte-aligned).

Use the extension properties BinarySize.Companion.bits and BinarySize.Companion.bytes to create instances: 256.bits or 32.bytes.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val inBits: Int

The value expressed as a number of bits.

Link copied to clipboard

The value expressed as a number of bytes (bits divided by 8).

Functions

Link copied to clipboard
open operator override fun compareTo(other: BinarySize): Int
Link copied to clipboard
operator fun div(other: Int): BinarySize
Link copied to clipboard
operator fun minus(other: BinarySize): BinarySize
Link copied to clipboard
operator fun plus(other: BinarySize): BinarySize
Link copied to clipboard
operator fun rem(other: Int): BinarySize
Link copied to clipboard
operator fun times(other: Int): BinarySize
Link copied to clipboard
open override fun toString(): String