How to generate a GUID in Oracle?

You can use the SYS_GUID() function to generate a GUID in your insert statement: insert into mytable (guid_col, data) values (sys_guid(), ‘xxx’); The preferred datatype for storing GUIDs is RAW(16). As Gopinath answer: select sys_guid() from dual union all select sys_guid() from dual union all select sys_guid() from dual You get 88FDC68C75DDF955E040449808B55601 88FDC68C75DEF955E040449808B55601 88FDC68C75DFF955E040449808B55601 As … Read more

How to generate a new GUID?

You can try the following: function GUID() { if (function_exists(‘com_create_guid’) === true) { return trim(com_create_guid(), ‘{}’); } return sprintf(‘%04X%04X-%04X-%04X-%04X-%04X%04X%04X’, mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)); } Source – com_create_guid

How securely unguessable are GUIDs?

UUIDs/GUIDs are specified by RFC4122. Although Version 4 UUIDs are created from random numbers Section 6 makes an explicit statement on security: Do not assume that UUIDs are hard to guess; they should not be used as security capabilities (identifiers whose mere possession grants access), for example. A predictable random number source will exacerbate the … Read more

A TypeScript GUID class? [closed]

Updated Answer This is now something you can do natively in JavaScript/TypeScript with crypto.randomUUID(). Here’s an example generating 20 UUIDs. for (let i = 0; i < 20; i++) { let id = crypto.randomUUID(); console.log(id); } Original Answer There is an implementation in my TypeScript utilities based on JavaScript GUID generators. Here is the code: … Read more