go.uuid

UUID package for Go (by satori)

Go.uuid Alternatives

Similar projects and alternatives to go.uuid

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better go.uuid alternative or higher similarity.

go.uuid reviews and mentions

Posts with mentions or reviews of go.uuid. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-27.
  • Writing UDF for Clickhouse using Golang
    2 projects | dev.to | 27 Feb 2024
    package main import ( "bufio" "encoding/binary" "encoding/hex" "fmt" "os" "strings" "time" ) func main() { scanner := bufio.NewScanner(os.Stdin) scanner.Split(bufio.ScanLines) for scanner.Scan() { id, _ := FromString(scanner.Text()) fmt.Println(id.Time()) } } func (me UUID) Nanoseconds() int64 { time_low := int64(binary.BigEndian.Uint32(me[0:4])) time_mid := int64(binary.BigEndian.Uint16(me[4:6])) time_hi := int64((binary.BigEndian.Uint16(me[6:8]) & 0x0fff)) return int64((((time_low) + (time_mid << 32) + (time_hi << 48)) - epochStart) * 100) } func (me UUID) Time() time.Time { nsec := me.Nanoseconds() return time.Unix(nsec/1e9, nsec%1e9).UTC() } // code below Copyright (C) 2013 by Maxim Bublis // see https://github.com/satori/go.uuid // Difference in 100-nanosecond intervals between // UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). const epochStart = 122192928000000000 // UUID representation compliant with specification // described in RFC 4122. type UUID [16]byte // FromString returns UUID parsed from string input. // Following formats are supported: // "6ba7b810-9dad-11d1-80b4-00c04fd430c8", // "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", // "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" func FromString(input string) (u UUID, err error) { s := strings.Replace(input, "-", "", -1) if len(s) == 41 && s[:9] == "urn:uuid:" { s = s[9:] } else if len(s) == 34 && s[0] == '{' && s[33] == '}' { s = s[1:33] } if len(s) != 32 { err = fmt.Errorf("uuid: invalid UUID string: %s", input) return } b := []byte(s) _, err = hex.Decode(u[:], b) return } // Returns canonical string representation of UUID: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. func (u UUID) String() string { return fmt.Sprintf("%x-%x-%x-%x-%x", u[:4], u[4:6], u[6:8], u[8:10], u[10:]) }
  • satori uuid vs google uuid vs gofrs uuid ? which to use to generate uuid for enterprise coding standards
    2 projects | /r/golang | 4 Sep 2023
    Link to source code :https://github.com/satori/go.uuid up to v5
  • Building web-based SaaS with Go as a solo entrepreneur. What should I be aware of?
    13 projects | /r/golang | 23 Jan 2023
    Something to note is that all of this is still open source. Theoretically, someone can decide to fork SQLBoiler and add all the missing things, or send in a PR. A good example is that the current most popular uuid package. gofrs/uuid was forked from an unmaintained previously popular package.
  • CVE-2021-3538 issued for latest release of github.com/satori/go.uuid
    4 projects | /r/golang | 6 May 2021
  • A note from our sponsor - WorkOS
    workos.com | 25 Apr 2024
    The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →

Stats

Basic go.uuid repo stats
4
4,856
0.0
8 months ago

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com