mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
14 lines
256 B
Go
14 lines
256 B
Go
|
// Copyright 2025 The Forgejo Authors
|
||
|
// SPDX-License-Identifier: MIT
|
||
|
package common
|
||
|
|
||
|
import (
|
||
|
"crypto/sha256"
|
||
|
"encoding/hex"
|
||
|
)
|
||
|
|
||
|
func Sha256(content string) string {
|
||
|
hashBytes := sha256.Sum256([]byte(content))
|
||
|
return hex.EncodeToString(hashBytes[:])
|
||
|
}
|