Kotlin/Js a ByteArray can be converted to a Uint8Array view, then populated with securely random data which will reflect as such in the ByteArray
val b = ByteArray(20)
val bchcBefore = b.contentHashCode()
val int8 = b.unsafeCast<Int8Array>()
val uint8 = Uint8Array(buffer = int8.buffer)
jsCryptoFill(uint8)
assertNotEquals(bchcBefore, b.contentHashCode())