franks42 / cljs-uuid-utils Goto Github PK
View Code? Open in Web Editor NEWMicro lib with ClojureScript implementation of a random, type 4 UUID generator compatible with cljs.core/UUID
License: Eclipse Public License 1.0
Micro lib with ClojureScript implementation of a random, type 4 UUID generator compatible with cljs.core/UUID
License: Eclipse Public License 1.0
Please create all new issues there
Hi!
Something is wrong with the types of generated UUIDs. Sorry for such a vague statement, I've been toying with js/cljs for about two weeks now, so I don't understand what is going on here.
Here is some code:
(def a (uuid/make-random-uuid))
(def b (uuid/make-uuid-from (str a)))
(type a) ; cljs.core/UUID
(type b) ; cljs.core/UUID
(= a b) ; false
(= a a) ; true
(= b b) ; true
(= a (uuid/make-uuid-from (str a))) ; false
(= b (uuid/make-uuid-from (str b))) ; true
this fails:
(> (cljs-uuid-utils/make-random-uuid) (cljs-uuid-utils/make-random-uuid))
also, .toString on UUIDs created by this lib does not return what i expect.
calling .toString on construction would fix these issues... but I see there is another v.similar cljs uuid lib that seems ok, so maybe take this one down from clojars? thanks
I get the following warning with the latest Clojurescript [org.clojure/clojurescript "0.0-2913"]
:
WARNING: cljs-uuid-utils is a single segment namespace at line 9 cljs_uuid_utils.cljs
Hey @franks42, thanks for the library!
Any chance of getting a non-snapshot release of 1.0.0?
It'd be great if your library included this simple fn:
(defn uuid-string
[uuid]
(str (.-uuid uuid)))
The reader literal is great, too, but sometimes you just want the 'raw' string, eg, for use on HTTP query-strings.
Of course, it should do the right thing if uuid
isn't a cljs.core/uuid
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.