Avoid integer overflow when computing shortcodes