go.uuid
llvm
Our great sponsors
go.uuid | llvm | |
---|---|---|
4 | 3 | |
4,856 | 4,403 | |
- | - | |
0.0 | 0.0 | |
8 months ago | over 3 years ago | |
Go | LLVM | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
go.uuid
-
Writing UDF for Clickhouse using Golang
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
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?
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
llvm
-
The Wonderfully Terrible World of C and C++ Text Encoding APIs (With Some Rust)
UTF-8 vs UTF-16 vs UTF-32 encoding/decoding are just simple data transformations [1], you don't need a 'complete UNICODE implemenentation' for this (and ISO/IEC be damned, those conversion functions would still be useful to have in the C and C++ stdlibs)
[1] https://github.com/llvm-mirror/llvm/blob/master/lib/Support/...
-
cross compiling issues with mingw32
It's more work to set up (unfortunately), but it's also possible to grab the MSVC and Windows SDKs from a Windows machine with MSVC installed, and then use those to cross-compile on Linux using clang-cl. LLVM has a CMake toolchain file demonstrating this. That'd let you build against the C++ standard library in the MSVC redistributable, so you wouldn't have to distribute it yourself.
-
Rediscovering Hamming Code
An extension to this infact is the following - https://github.com/llvm-mirror/llvm/blob/f36485f7ac2a8d72ad0...
So the original user's comment might infact get detected by this and get optimised down to using popcnt. Will need to try it out. :-)
What are some alternatives?
uuid - Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.
llvm - LLVM based obfuscator
golang-templates/seed - Go application GitHub repository template.
bexp - Go implementation of Brace Expansion mechanism to generate arbitrary strings.
go-shortid - Super short, fully unique, non-sequential and URL friendly Ids
llvm-hs-pretty - Pretty printer for LLVM AST to Textual IR
autoflags - Populate go command line app flags from config struct
ghorg - Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more 🥚
go-chat-bot - IRC, Slack, Telegram and RocketChat bot written in go
Tideland Go - Go Library [DEPRECATED]
conv - Fast conversions across various Go types with a simple API.
strutil - String utilities for Go