common declarations.

id, info_type, hash_type, error, invalid_id_error declaration.
is_allowed_id() and validate_id() implementation.
Refactoring: hash_type -> hash, info_type -> info.