https://github.com/woltapp/blurhash/blob/712a47f946b98c30097eb1ada086ea00b18681ec/Swift/BlurHashDecode.swift#L131 This kind of String indexing leads to quadratic complexity if used in loops. And this is exactly what happens in decoding.