Giter Club home page Giter Club logo

Comments (6)

satori avatar satori commented on August 11, 2024 1

Closed by merging #54

from go.uuid.

jlburkhead avatar jlburkhead commented on August 11, 2024

why not write a wrapper around uuid.FromString?

func uuidFromString(s string) (uuid.UUID, error) {
	if len(s) == len(uuid.Nil.String()) {
		return uuid.FromString(s)
	}
	b, err := hex.DecodeString(s)
	if err != nil {
		return uuid.Nil, err
	}
	return uuid.FromBytes(b)
}

from go.uuid.

duaneking avatar duaneking commented on August 11, 2024

I thank you for your response, but wouldn't that wrapper be much slower than a more native implementation?

from go.uuid.

 avatar commented on August 11, 2024

To my knowledge the dashes are in the standard so not having them is non-standard and you should handle those cases on your own.

from go.uuid.

daskol avatar daskol commented on August 11, 2024

@duaneking Look at issue #54. I proposed there more efficient implementation than @jlburkhead suggested. Moreover if you do not want apply my patch by yourself you could use fork of @edadeal. We maintain and develop this project since @satori stop maintaince and even do not reply any comments.

from go.uuid.

duaneking avatar duaneking commented on August 11, 2024

👍

from go.uuid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.