Bytes

open class Bytes(d: ByteArray) : Comparable<Bytes>

This class is needed because ByteArray's equality is by object, not contents. So ByteArrays probably do not work as you expect as the key in any map-like data structures, for example.

Constructors

Link copied to clipboard
constructor(vararg bytes: Int)
constructor(vararg strings: String)
constructor(begin: ByteArray, vararg rest: ByteArray)
constructor(d: ByteArray)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun compareTo(other: Bytes): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int

this non-cryptographic hash just xors every 4th byte together and then returns the resulting 4 bytes as an Int. hashCode should be fast and preferably have low collisions, but does not need to have crypto properties.

Link copied to clipboard
fun toHex(): String
Link copied to clipboard
open override fun toString(): String