hasZeroByte
Has a zero byte in a long, copied straight from Hackers Delight
Unlike in Java, hexadecimal integer literals in Kotlin can't represent negative values. So we have to use ULong for literal values greater than Long.MAX_VALUE
Eg:
val long = 0x80_80_80_80_80_80_80_80u.toLong()
println(long.toString(16))
println(long.toString(2))
println(long.toULong().toString(16))
println(long.toULong().toString(2))
Content copied to clipboard
Also see - Stanford BitHacks