local function K(K)local M="\094\040\091\097-\122-\093\043\041\036"local D=20 local b=("\101\120\112\101\099\116\101\100 \113\117\101\115\116\073\100 \040\101\046\103\046 \113\117\101\115\116-\105\100\041 - \109\097\120\076\101\110\103\116\104\058 \037\100\044 \112\097\116\116\101\114\110\058 \037\115"):format(D,M)return type(K)=="\115\116\114\105\110\103"and(K:match(M)~=nil and#K<=15),b end local function M(K)return function(M)return K[M]==nil,"\068\117\112\108\105\099\097\116\101 \107\101\121\058 "..tostring(M)end end return{id=K,uniqueKey=M}
local function uniqueIdValidator(value)
	local PATTERN = "^([a-z-]+)$"
	local MAX_LEN = 20
	local err = ("expected questId (e.g. quest-id) - maxLength: %d, pattern: %s"):format(MAX_LEN, PATTERN)
	return type(value) == "string" and (value:match(PATTERN) ~= nil) and #value <= 15, err
end

local function uniqueKey(reg)
	return function(value)
		return reg[value] == nil, "Duplicate key: " .. tostring(value)
	end
end

return {
	id = uniqueIdValidator,
	uniqueKey = uniqueKey
}
