COMMUNITY

How to perform 64bit binary operations

In the documentation I’ve noticed that bitwise operations return Int.

Is there any way to have get around this limitation?

My use case is as follows:

var key: Int64 = 82        // 0101 0010
var signature: Int64 = 214 // 1101 0110 

if ((key & signature) == key) {
    // we have a match so do work
}

Obviously in my example a regular Int would suffice but my use case will require more bits.

My thinking is to get access to the binary and some how split it up to work with the separate parts but I can’t find any documentation indicating there is a way to work directly with binary.

I have this library, which allows to have bit flags with arbitrary amount of bits: https://lib.haxe.org/p/bits/