local function next_trigram (message, index) index = (index or 0) + 1 local offset = (index - 1) * 3 local a = message[offset + 1] if not a then return nil end return index, a, message[offset + 2], message[offset + 3] end local function next_value (message, index) local a, b, c index, a, b, c = next_trigram(message, index) if not index then return nil end return index, a * 25 + b * 5 + c end local reading = { next_trigram = next_trigram, next_value = next_value, } function reading.trigrams (message, start) return next_trigram, message, start end function reading.values (message, start) return next_value, message, start end return reading