lib/battleLib.js
// gets hex representation as string, with optional padding
gets hex representation as string, with optional padding
gets hex representation as string with optional padding
function toHexString(number, pad){
    pad = pad || 0
    if (pad - number.toString(16).length > 0){
        return ("0".repeat(pad - number.toString(16).length) + number.toString(16))
    } else {
        return number.toString(16)
    }
}
function toHexString ( number , pad ) { pad = pad || 0 if ( pad - number . toString ( 16 ) . length > 0 ) { return ( "0" . repeat ( pad - number . toString ( 16 ) . length ) + number . toString ( 16 ) ) } else { return number . toString ( 16 ) } }
gets hex representation as string, with optional padding
gets hex representation as string with optional padding