Documentation
¶
Overview ¶
Copyright © 2026 Alessandro Riva
Licensed under the MIT License. See the LICENSE file for details.
Copyright © 2024 Alessandro Riva ¶
Licensed under the MIT License. See the LICENSE file for details.
Copyright © 2024 Alessandro Riva ¶
Licensed under the MIT License. See the LICENSE file for details.
Index ¶
- Variables
- func Base64Decode(input string) (string, error)
- func Base64Encode(input string) string
- func Defang(input string) string
- func DefangEmail(email string) string
- func DefangURL(url string) string
- func Fang(input string) string
- func URLDecode(input string) (string, error)
- func URLEncode(input string) string
- type HashAlgorithm
- type HashResult
Constants ¶
This section is empty.
Variables ¶
var HashAlgorithms = []HashAlgorithm{ {Name: "MD5", New: md5.New, Deprecated: true}, {Name: "SHA1", New: sha1.New, Deprecated: true}, {Name: "SHA256", New: sha256.New}, {Name: "BLAKE3", New: func() hash.Hash { return blake3.New(32, nil) }}, }
HashAlgorithms lists the algorithms computed by HashFile, in output order. Register a new algorithm by appending to this slice.
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func DefangEmail ¶
Types ¶
type HashAlgorithm ¶
type HashResult ¶
func HashFile ¶
func HashFile(path string) ([]HashResult, error)
HashFile opens path and hashes it with every registered algorithm.
func HashFileWith ¶
func HashFileWith(path string, algos []HashAlgorithm) ([]HashResult, error)
HashFileWith opens path and hashes it with the given algorithms only.
func HashReader ¶
func HashReader(r io.Reader) ([]HashResult, error)
HashReader computes the hex digest of every registered algorithm for the contents of r.
func HashReaderWith ¶
func HashReaderWith(r io.Reader, algos []HashAlgorithm) ([]HashResult, error)
HashReaderWith computes the hex digest of each given algorithm for r. Each algorithm runs in its own goroutine so large inputs are hashed in parallel across CPU cores.