diff options
author | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
---|---|---|
committer | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
commit | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/hashicorp/terraform/helper/hashcode/hashcode.go | |
parent | 07971ca38143c5faf951d152fba370ddcbe26ad5 (diff) | |
download | terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip |
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/helper/hashcode/hashcode.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/helper/hashcode/hashcode.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/helper/hashcode/hashcode.go b/vendor/github.com/hashicorp/terraform/helper/hashcode/hashcode.go index 64d8263..6ccc523 100644 --- a/vendor/github.com/hashicorp/terraform/helper/hashcode/hashcode.go +++ b/vendor/github.com/hashicorp/terraform/helper/hashcode/hashcode.go | |||
@@ -1,6 +1,8 @@ | |||
1 | package hashcode | 1 | package hashcode |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "bytes" | ||
5 | "fmt" | ||
4 | "hash/crc32" | 6 | "hash/crc32" |
5 | ) | 7 | ) |
6 | 8 | ||
@@ -20,3 +22,14 @@ func String(s string) int { | |||
20 | // v == MinInt | 22 | // v == MinInt |
21 | return 0 | 23 | return 0 |
22 | } | 24 | } |
25 | |||
26 | // Strings hashes a list of strings to a unique hashcode. | ||
27 | func Strings(strings []string) string { | ||
28 | var buf bytes.Buffer | ||
29 | |||
30 | for _, s := range strings { | ||
31 | buf.WriteString(fmt.Sprintf("%s-", s)) | ||
32 | } | ||
33 | |||
34 | return fmt.Sprintf("%d", String(buf.String())) | ||
35 | } | ||