EKAB33DH2HL3KANJVE7W5YNH3URGEPLNDPISI6GUVCPAXPDDQOQQC
package pijul
import (
"bytes"
"fmt"
)
type parser[T any] func(input []byte) (rest []byte, value T, err error)
func takeUntil(tag string) parser[[]byte] {
b := []byte(tag)
return func(input []byte) (rest []byte, value []byte, err error) {
i := bytes.Index(input, b)
if i == -1 {
return input, nil, fmt.Errorf("not found: %q", tag)
}
return input[i:], input[:i], nil
}
}
func alt[T any](options ...parser[T]) parser[T] {
return func(input []byte) (rest []byte, value T, err error) {
for _, opt := range options {
rest, value, err = opt(input)
if err == nil {
return
}
}
return input, value, err
}
}
func mapValue[T, U any](p parser[T], f func(T) U) parser[U] {
return func(input []byte) (rest []byte, value U, err error) {
rest, v, err := p(input)
if err != nil {
return input, value, err
}
return rest, f(v), nil
}
}
func mapWithError[T, U any](p parser[T], f func(T) (U, error)) parser[U] {
return func(input []byte) (rest []byte, value U, err error) {
rest, v, err := p(input)
if err != nil {
return input, value, err
}
value, err = f(v)
return rest, value, err
}
}
key = 'BCEXYuKWaQ96btsk8UyBZWHLjn1Brhykv8tuZGPRjzFn'`,
key = 'BCEXYuKWaQ96btsk8UyBZWHLjn1Brhykv8tuZGPRjzFn'
# Dependencies
[2] AYY5CBLPBVTCHWSC7HDSZDL7KCUFJNX3NPNN6Q7ITTWF232IS4PQC #
# Hunks
1. File addition: "gibberish" in "" "binary"
up 2.1, new 1618:1638
+bNNvYtlLoV3Y1kBH+M6aYBLgbaELfFQ2LWaqt+ua4jfk03SsdP1REIIFftFFB3LQZqE3sdQBE1OLaYXfyOj5UdH6SKsdP7Rm1D2Vt7Nlh9FFV9WbKzdRTBaszwEGwj14AO/nBq8gBxLbJYxqawkKvg/1GHTutdba37RoqTFP7UNRvD2G/oe17Tvz2C/hSMpMgm9WbRgpcMrRtGGv7CNBXIgxSUVTeWpyAxQ+EoPf6OMyY7LKH8sB4Tpb+eZK2SstrNdyTMAYFxdfAIctfV7eG3AyN3m3p5xTlKRPIL3/r9MsN05sDJ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HyTQW+lvPOSdxBHZKOBjCL2eEHNDkOvrIy2QWK9oVf2kZT9K+aMYdG4okT333huzGvlj5b8f+qGwG1MvTnLodzhmtikDr//B74zpQAYHHMfGukZOQ7sdnOAGdeWCBxkrTRLo8Ao2c9ILL/ZzEAtOtroPIHh2kEvS2CL1270ayW9c8s1/ywMv21MsvYcprtUtMhgv3ohwdjJHCP365OghWNUe1Om7t+McW51k9lyOMYUiH0FoOk2JMC7oqi0InCuxA7d2x8H+TELZRy3dz68cGW4eEGa2lha1URi0JUBEdS8AQLqjPXAw2AkZbOSPJrLnb7aasfOp6twzr4Qx36nVKQVp2/F/5diZeaYBkbeM8vwVVh9EO7BM4RZ1mKcsl0wv2TVSknNdmYzcJnZPzUFsOs+Fq8WXsql80WAvIfN5aBZX/aMW1G4iXCMO00YAR5c/fQ5nkCf9N9LvAbv+oCrkO9xz7f6b5dr+ywVDGii/nK0FN//ul4pUYvjoSVxdWLuMekcxs4OeXotPmm5ce3Pua9dUJGGzeUGf3mQxuqDxX4PGAmAfzN4siLWp/vc7PVbXSZqApxJIr88umEjT0PUKuL3SKcY9bu9UhHlcHB2t1zWfslBIuXjBK4TG+lE8RdxSLPyqkSxmvtijhfcaDDxUudNc6cWcO7zaHoaC2ocKY7Vyf8F1V3pmathXstd0EVnsJ28qveq6AkLz2TbpMAEX6bBNb44FX3qj8dupddJdfs9DuQDj8elujAu1LMXCErHzv4b4wCg==
`,
func parseChangeHeader(input []byte) (rest []byte, value ChangeHeader, err error) {
return mapWithError(
alt(takeUntil("# Dependencies"), takeUntil("# Hunks")),
decodeChangeHeader,
)(input)
}