function hexVal(hash, index, len) {
	return parseInt(hash.substr(index, len || 1), 16);
}
Extract a substring from a hex string and parse it as an integer
@param {string} hash - Source hex string
@param {number} index - Start index of substring
@param {number} [length] - Length of substring. Defaults to 1.