uuid

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2024 License: AGPL-3.0 Imports: 3 Imported by: 1

README

uuid4

My own minimalist Go library that generates uuid's that implement v4, variant 10.

Securely uses crypto/rand for random number generation.

Usage

First, get it:

go get -v git.cmcode.dev/cmcode/uuid

Now, in a main.go file:

package main

import (
    "log"

    uuid "git.cmcode.dev/cmcode/uuid"
)

func main() {
    u := uuid.New() // generates the uuid
    log.Println(u)  // prints the uuid to console
}

You can also check out uuid_test.go to see the unit tests.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() string

New generates a uuid v4 variant 10. If an error is encountered when trying to acquire cryptographically secure randomness for the UUID, the app will panic.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL