Skip to content
go-libfossil Artifact [30bc4b1001]
Login

Artifact [30bc4b1001]

Artifact 30bc4b10018b0e9f9875d2be9b66efaf757ed4fd135a57189e994a3de1cf4f12:


package hash_test

import (
	"fmt"

	"github.com/danmestas/libfossil/internal/hash"
)

func ExampleSHA1() {
	uuid := hash.SHA1([]byte("hello"))
	fmt.Println(uuid)
	fmt.Println(hash.IsValidHash(uuid))
	// Output:
	// aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
	// true
}

func ExampleSHA3() {
	uuid := hash.SHA3([]byte("hello"))
	fmt.Println(len(uuid)) // 64 hex chars = SHA3-256
	fmt.Println(hash.IsValidHash(uuid))
	// Output:
	// 64
	// true
}