Import upstream version 1.0.13+git20211212.1.1f10f98+ds
Debian Janitor
1 year, 3 months ago
6 | 6 | "crypto/sha1" |
7 | 7 | "encoding/hex" |
8 | 8 | "fmt" |
9 | "github.com/pkg/errors" | |
10 | 9 | "math" |
11 | 10 | "os" |
11 | ||
12 | "github.com/pkg/errors" | |
12 | 13 | ) |
13 | 14 | |
14 | 15 | type PdfWriter struct { |
226 | 227 | |
227 | 228 | func (this *PdfWriter) shaOfInt(i int) string { |
228 | 229 | hasher := sha1.New() |
229 | hasher.Write([]byte(fmt.Sprintf("%s-%s", i, this.r.sourceFile))) | |
230 | hasher.Write([]byte(fmt.Sprintf("%d-%s", i, this.r.sourceFile))) | |
230 | 231 | sha := hex.EncodeToString(hasher.Sum(nil)) |
231 | 232 | return sha |
232 | 233 | } |
322 | 323 | |
323 | 324 | case PDF_TYPE_BOOLEAN: |
324 | 325 | if value.Bool { |
325 | this.straightOut("true") | |
326 | this.straightOut("true ") | |
326 | 327 | } else { |
327 | this.straightOut("false") | |
328 | this.straightOut("false ") | |
328 | 329 | } |
329 | 330 | break |
330 | 331 |