src/builders/DecimalBuilder.php
public function makeFrontSideMask($maskLength, $byteLength) {
        $maskValue = 0;
        $bitLength = $byteLength * 8;
        $maskString = "";
        $valueStore = 0;
        for ($i = 0; $i < $bitLength; $i++) {
            $maskValue <<= 1;
            if ($i < $maskLength) {
                $maskValue += 1;
            }
            $valueStore++;
            $binRep = BinaryStringAtom::createHumanReadableBinaryRepresentation($maskValue);
            if ($valueStore == 8) {
                $char = chr($maskValue);
                $maskString .= $char;
                $maskValue = 0;
                $valueStore = 0;
            }
        }
        return $maskString;
    }
public function makeFrontSideMask($maskLength, $byteLength) {
        $maskValue = 0;
        $bitLength = $byteLength * 8;
        $maskString = "";
        $valueStore = 0;
        for ($i = 0; $i < $bitLength; $i++) {
            $maskValue <<= 1;
            if ($i < $maskLength) {
                $maskValue += 1;
            }
            $valueStore++;
            $binRep = BinaryStringAtom::createHumanReadableBinaryRepresentation($maskValue);
            if ($valueStore == 8) {
                $char = chr($maskValue);
                $maskString .= $char;
                $maskValue = 0;
                $valueStore = 0;
            }
        }
        return $maskString;
    }
public function makeFrontSideMask ( $ maskLength , $ byteLength ) { $ maskValue = 0 ; $ bitLength = $ byteLength * 8 ; $ maskString = "" ; $ valueStore = 0 ; for ( $ i = 0 ; $ i < $ bitLength ; $ i ++ ) { $ maskValue <<= 1 ; if ( $ i < $ maskLength ) { $ maskValue += 1 ; } $ valueStore ++ ; $ binRep = BinaryStringAtom :: createHumanReadableBinaryRepresentation ( $ maskValue ) ; if ( $ valueStore == 8 ) { $ char = chr ( $ maskValue ) ; $ maskString .= $ char ; $ maskValue = 0 ; $ valueStore = 0 ; } } return $ maskString ; }
This function makes a mask that has one's in the highest bit-values, and 0's in the lower bit-values.

For example, when passed the parameters (3,1) it produces a binary string 0b11100000;

Public function for testing.

@param int $maskLength
@param int $bitLength
@return string
This function makes a mask that has one s in the highest bit - values and 0 s in the lower bit - values .