public static string ValidateRecordKey(string key) { if (string.IsNullOrEmpty(key) || Encoding.UTF8.GetByteCount(key) > 128) { throw new ArgumentException("Invalid record key"); } return key; }