Skip to content

Commit

Permalink
Use sha256 for template hash to satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarsa authored and gambol99 committed Apr 19, 2024
1 parent 04c539e commit 4e54022
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/utils/jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package jobs

import (
"bytes"
"crypto/sha1"
"encoding/hex"
"crypto/sha256"
"encoding/base32"
"encoding/json"
"fmt"
"strings"
Expand Down Expand Up @@ -267,10 +267,10 @@ func (r *Render) createTerraformFromTemplate(options Options, stage string) (*ba
}

func TemplateHash(data []byte) (string, error) {
hash := sha1.New()
hash := sha256.New()
_, err := hash.Write(data)
if err != nil {
return "", err
}
return strings.ToLower(hex.EncodeToString(hash.Sum(nil))), nil
return strings.ToLower(base32.StdEncoding.WithPadding(base32.NoPadding).EncodeToString(hash.Sum(nil))), nil
}

0 comments on commit 4e54022

Please sign in to comment.