how do i make this bitwise code more concise? : my bitwise code which works is ..

	#!/bin/bash -e

	random=$((RANDOM % 32));

	bitWiseAnd() {
		local IFS='&'
		printf "%s\n" "$(( $* ))"
	}

	echo "random=${random}";

	if [ $(bitWiseAnd ${random} "0x10") -ne 0 ]; then
		echo "1"
	else
		echo "0"
	fi

	if [ $(bitWiseAnd ${random} "0x8") -ne 0 ]; then
		echo "1"
	else
		echo "0"
	fi

	if [ $(bitWiseAnd ${random} "0x4") -ne 0 ]; then
		echo "1"
	else
		echo "0"
	fi

	if [ $(bitWiseAnd ${random} "0x2") -ne 0 ]; then
		echo "1"
	else
		echo "0"
	fi

	if [ $(bitWiseAnd ${random} "0x1") -ne 0 ]; then
		echo "1"
	else
		echo "0"
	fi

example output is ...

> random=15

> 0

> 1

> 1

> 1

> 1

I have no idea how this code works, how would i make this code more concise?

many thanks
