Remix.run Logo
foxglacier 5 hours ago

Copyright is for creative work so if it really is the best way to do it, you should be safe even if the AI copied the idea from somebody else. You can't use copyright to restrict access to useful technology like a patent.

4 hours ago | parent | next [-]
[deleted]
4 hours ago | parent | prev | next [-]
[deleted]
willtemperley 4 hours ago | parent | prev [-]

That's very useful feedback. I suspect if the solution is irreducible it's OK, which in this case is close to true (this is for bit-unpacking integers):

    // bytes are added to the buffer until a value of bitwidth is available
    for _ in 0..<bitWidth {
        let byte = try UInt8(parsing: &input)
        buffer |= UInt64(byte) << bitsInBuffer
        bitsInBuffer += 8
      // Values of bitwidth are right-shifted off the buffer.
      while bitsInBuffer >= bitWidth && outPos < numValues {
          let value = Int(buffer & mask)
          out[outPos + outOffset] = value
          outPos += 1
          buffer >>= bitWidth
          bitsInBuffer -= bitWidth
      }
    }