Created a function which abstracts encoding a major type and it's data length/value
Created a function which abstracts encoding a major type and it's data length/value

This function uses mostly the same code as the original encodeInteger
function. The encodeInteger function now calls this one.

Lemonblast/Cbor4Php