DROP FUNCTION IF EXISTS mocha_normalize_uuid;

CREATE FUNCTION mocha_normalize_uuid(p_uuid CHAR(40))
	RETURNS CHAR(32) NO SQL
BEGIN

	RETURN LOWER(REPLACE(REPLACE(REPLACE(p_uuid, '{', ''), '}', ''), '-', ''));

END