[Discuss] Delete UUID V4 Library

I noticed that Ghost only uses UUID version 4, so installing the uuid library unnecessarily increases the project size.

I think it should be replaced with crypto.randomUUID(). What do you think?

1 Like

Would your proposal result in UUIDs of the same length?

I looked at what UUID v4 does, it and seems to boil down to this:

crypto.createHash('md5').update(bytes).digest();

From reading the docs of crypto.randomUUID(), it would work:

https://nodejs.org/api/crypto.html#cryptorandomuuidoptions

It’s probably that the Ghost project is so old that it pre-dates the existence of this built-in method, which was only added in Node 15.6 and 14.17.