Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to back String from UUID in node-js

Using express-cassandra i am generating an uuid by uuidFromString() method. Is there any way to back it to its previous form.

like image 369
Shakil Avatar asked Nov 17 '16 19:11

Shakil


1 Answers

Yes, just use the toString() method on the Uuid object you generated. For example:

var myUuid = Uuid.fromString('ce547c40-acf9-11e6-80f5-76304dec7eb7');
var myUuidString = myUuid.toString();

Since express-cassandra is just using the DataStax driver under the covers, you can see the Uuid docs here:

http://docs.datastax.com/en/drivers/nodejs/3.0/module-types-Uuid.html

like image 110
Luke Tillman Avatar answered Nov 13 '22 01:11

Luke Tillman