20 lines
247 B
Go
Executable File
20 lines
247 B
Go
Executable File
package form
|
|
|
|
import (
|
|
"fmt"
|
|
"hash/fnv"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
func NewUUID() string {
|
|
uuid := uuid.New().String()
|
|
return Hash(uuid)
|
|
}
|
|
|
|
func Hash(s string) string {
|
|
h := fnv.New32a()
|
|
h.Write([]byte(s))
|
|
return fmt.Sprint(h.Sum32())
|
|
}
|