Codebase list golang-github-phpdave11-gofpdi / ab739f9
Import upstream version 1.0.13+git20211212.1.1f10f98+ds Debian Janitor 1 year, 3 months ago
1 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
66 "crypto/sha1"
77 "encoding/hex"
88 "fmt"
9 "github.com/pkg/errors"
109 "math"
1110 "os"
11
12 "github.com/pkg/errors"
1213 )
1314
1415 type PdfWriter struct {
226227
227228 func (this *PdfWriter) shaOfInt(i int) string {
228229 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)))
230231 sha := hex.EncodeToString(hasher.Sum(nil))
231232 return sha
232233 }
322323
323324 case PDF_TYPE_BOOLEAN:
324325 if value.Bool {
325 this.straightOut("true")
326 this.straightOut("true ")
326327 } else {
327 this.straightOut("false")
328 this.straightOut("false ")
328329 }
329330 break
330331