func as_hex(b byte) int {
	if b >= 'A' && b <= 'F' {
		return int(b) - 'A' + 10
	} else if b >= 'a' && b <= 'f' {
		return int(b) - 'a' + 10
	}
	return int(b) - '0'
}
/*
* Get the value of a hex-digit.
package candiedyaml
const (
	INPUT_RAW_BUFFER_SIZE = 1024
	INPUT_BUFFER_SIZE = (INPUT_RAW_BUFFER_SIZE * 3)
	OUTPUT_BUFFER_SIZE = 512
	OUTPUT_RAW_BUFFER_SIZE = (OUTPUT_BUFFER_SIZE*2 + 2)
	INITIAL_STACK_SIZE = 16
	INITIAL_QUEUE_SIZE = 16
)
func width(b byte) int {
	if b&0x80 == 0 {
		return 1
	}
	if b&0xE0 == 0xC0 {
		return 2
	}
	if b&0xF0 == 0xE0 {
		return 3
	}
	if b&0xF8 == 0xF0 {
		return 4
	}
	return 0
}
func copy_bytes(dest []byte, dest_pos *int, src []byte, src_pos *int) {
	w := width(src[*src_pos])
	switch w {
	case 4:
		dest[*dest_pos+3] = src[*src_pos+3]
		fallthrough
	case 3:
		dest[*dest_pos+2] = src[*src_pos+2]
		fallthrough
	case 2:
		dest[*dest_pos+1] = src[*src_pos+1]
		fallthrough
	case 1:
		dest[*dest_pos] = src[*src_pos]
	default:
		panic("invalid width")
	}
	*dest_pos += w
	*src_pos += w
}
func is_alpha(b byte) bool {
	return (b >= '0' && b <= '9') ||
		(b >= 'A' && b <= 'Z') ||
		(b >= 'a' && b <= 'z') ||
		b == '_' || b == '-'
}
func is_digit(b byte) bool {
	return b >= '0' && b <= '9'
}
func as_digit(b byte) int {
	return int(b) - '0'
}
func is_hex(b byte) bool {
	return (b >= '0' && b <= '9') ||
		(b >= 'A' && b <= 'F') ||
		(b >= 'a' && b <= 'f')
}