{"name":"BIS_fnc_encodeFlags2","title":"BIS fnc encodeFlags2","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_encodeFlags2","revid":337995,"updated":"2023-02-23T21:11:09Z","groups":["Bitwise"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","description":"Encodes array of unique binary flags (zeroes or ones) into a single scalar.\n\n> [!IMPORTANT]\n> Note that the input array is in [Big Endian](https://en.wikipedia.org/wiki/Endianness#Definition), meaning that the smallest value is **to the left**.","syntaxes":[{"syntax":"arrayOfNumbers call BIS_fnc_encodeFlags2","params":[{"name":"arrayOfNumbers","type":"Array of Numbers","description":"\"boolean\" flags where 0 = false and 1 = true","type_expr":"Array<Number>"}],"returns":{"type":"Number","type_expr":"Number","description":"the calculated number"}}],"examples":[{"code":["private _result = [1,0,1,1] call BIS_fnc_encodeFlags2;\nhint str _result; // Displays 13"]}],"see_also":["BIS_fnc_encodeFlags","BIS_fnc_encodeFlags4","BIS_fnc_encodeFlags8","BIS_fnc_decodeFlags","BIS_fnc_decodeFlags2","BIS_fnc_decodeFlags4","BIS_fnc_decodeFlags8"]}