commit e209e99757f877b6f394c38af7cbe0caf5d0cf6d Author: Jean-Louis Huynen Date: Wed May 29 15:51:56 2019 +0200 new: [repo] MIT licence, hash package diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f1c181e --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b33822d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 D4 project + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/config/config.go b/config/config.go new file mode 100644 index 0000000..e69de29 diff --git a/crypto/hash.go b/crypto/hash.go new file mode 100644 index 0000000..36d08c3 --- /dev/null +++ b/crypto/hash.go @@ -0,0 +1,20 @@ +package hash + +import ( + uuid "github.com/gofrs/uuid" +) + +// NewV4 returns a randomly generated UUID. +func NewV4() (uuid.UUID, error) { + return uuid.NewV4() +} + +// FromString returns a UUID parsed from the input string. +func FromString(input string) (uuid.UUID, error) { + return uuid.FromString(input) +} + +// FromBytesOrNil returns a UUID generated from the raw byte slice input. +func FromBytesOrNil(input []byte) uuid.UUID { + return uuid.FromBytesOrNil(input) +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..aa65077 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module requirements.go + +go 1.12 + +require github.com/gofrs/uuid v3.2.0+incompatible diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..f27a074 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= +github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= diff --git a/requirements.go b/requirements.go new file mode 100644 index 0000000..40aabe4 --- /dev/null +++ b/requirements.go @@ -0,0 +1,7 @@ +package main + +import ( + _ "github.com/gofrs/uuid" +) + +func main() {}