
function __BP_CODE_DataFormat()
{
	this.lastError = null;
	this.checkData = __BP_CODE_checkData;
	this.formatData = __BP_CODE_formatData;
	this.__rx = new RegExp("^[A-z0-9\_]{1,64}$");
}

function __BP_CODE_checkData(value)
{
	if(value.length > 64)
	{
		this.lastError = "LENGTH";
		return false;
	}
	if(value.match(this.__rx) == null)
	{
		this.lastError = "CHARS";
		return false;
	}
	return true;
}

function __BP_CODE_formatData(value)
{
	if(!this.checkData(value))
		return null;
	return value;
}
