Questions tagged [uuid]

1

votes
2

answer
48

Views

Shorter version of UUID4

I'm generating in python uuid4 strings. I use it to identify my service accounts, but one of my systems (GCP service accounts) has a 30 char limit, and it's too late to use something else : Service account ID must be between 6 and 30 characters. Service account ID must start with a lower case letter...
switch
0

votes
0

answer
7

Views

Python Pass API-Key and API-UUID to remote API

I'm new to Python. And am trying to connect to a remote restful api. I have the endpoint url. As well as an API Key and an API UUID that I'm told to pass to server (not sure about the proper term). Right now, with what little I know, I have this: import requests from requests.auth import HTTPBasi...
jjfredericks
1

votes
4

answer
1.5k

Views

How do I ensure unique id is indeed unique in Rails?

I want to replace an object's url from /object/123 to /object/f8a3b2, so instead of using the id column I'm generating an uid column manually when the object is created. I can use the uuid libraries available to generate uid, but how do I make sure that the generated value is always unique? I have a...
foobar
1

votes
1

answer
238

Views

Hibernate/JPA persist OneToMany objects with generated UUID's

I have been using Hibernate a lot but using Hibernate/JPA with UUID got me stumped a bit. I am using hibernate 5.2.12.Final. I have an object called TimePeriod with this mapping: @Entity(name = 'time_period') public class TimePeriod extends AbstractDomainObject { @OneToMany(mappedBy = 'timePeri...
Ivo Limmen
1

votes
2

answer
445

Views

Passing a variable between pipes in Gulp 3.9.1

Using gulp 3.9.1 I am attempting to return a bunch of files and perform a task that requires a var to be passed between two pipes. I'm using node uuid to create a v3 UUID for each file path to ultimately end up with a uuid for each page. I'm grabbing the file path with gulp-print. I want to store th...
Greg
1

votes
1

answer
449

Views

Convert a UUID into a GUID and vice versa

I have this UUID which is changed inside a hqlQuery result when querying a MSSQL database: createQuery('... where UUID = '917f116e-3447-4524-a959-ece721413f93'').list() //finds the right object but returns an object with a modified UUID 6e117f91-4734-2445-a959-ece721413f93 917f116e-3447-4524-a959-ec...
Gobliins
1

votes
0

answer
117

Views

Duplication of UUID generated in JAVA using AWS

I have been using the code below to generate my UUID and post it in the database : if (addData.getGeneratedDocId() == null || addData.getGeneratedDocId().equals('')) { //addData.setGeneratedDocId(uniqueID); addData.setGeneratedDocId(UUID.randomUUID().toString()); } The problem is when I deploy my w...
Aaron Lee Herng Yue
1

votes
0

answer
47

Views

Use UUID version 1 or 4 for iCloud clientId

In all of the examples I've been able to find with people using the iCloud API, they seem to set the clientId by generating a random UUIDv1 and making it uppercase (usually). I also understand that UUIDv1 and UUIDv4 differ in that UUIDv1 won't generate collisions because it's based on MAC address an...
FyZyX
1

votes
0

answer
628

Views

Equivalent to python's uuid.uuid4().hex in javascript?

Python has functionality to create hex UUID's like so: >>> import uuid >>> uuid.uuid4().hex '47be94c37e484e13ab04ed3c54a5b681' Is it possible to do the same in client javascript, with the same hex formatting? Is there a way to 'validate' the UUID the client sends back? I.e. prevent or notice if a ma...
raphaelrk
1

votes
0

answer
155

Views

Python UUID assign most/least significant bits

Java can create a UUID from an assigned most/least significant 64 bits. I read through Python's UUID documentation but could not find a simple way to do that. I saw you can supply a fields argument, but it is split to 6 arguments (3 for most sig bits and 3 for least sig bits). I'm not sure how to s...
Solidak
1

votes
0

answer
527

Views

node-machine-id npm library and the actual uniqueness

I was testing the npm node-machine-id. It works fine to generate a 'unique' machine id. However, I was hoping to get some additional advice on if this would be the best option for my needs. In summary, I am building an electron app that will get deployed on the local station. This app will need to...
jremi
1

votes
1

answer
114

Views

How to add a uuid to a rasa chatbot for each user?

I am developing a chatbot from this repository, which I only interconnected with Slack at the moment, and I want him to be able to identify the user. So do you know how to get something online that can generate a unique user identification for each user (the user IDs for the research should have the...
ThePassenger
1

votes
0

answer
99

Views

Generating UUID in Django migrations (RunPython) is generating identical UUID

Similarly to the question here, I'm trying to add a unique UUID field to a database table with existing rows. I've tried to follow the instructions and break down the migration into 3 operations: def create_user_id(apps, schema_editor): User = apps.get_model('authentication', 'User') for instance in...
Jad S
1

votes
0

answer
494

Views

PSQLException: Can't infer the SQL type … Use setObject() (I am using it!)

Hi maybe I can get some help here once again! I am testing a server to connect to a DB and so far it works and I can insert UUID Data. But when I try to migrate to another project, the same function doesn't work as it should. It doesn't save the data in the DB...I have checked everything but there m...
EdC
1

votes
1

answer
23

Views

How to get correctly difference new generated unique ids and full list of all ids?

I have sample function for generate unique ids: function generate_uuid($needed_ids_num = 1, int $random_bytes_length = 6) { $ids = []; while (count($ids) < $needed_ids_num) { $id = bin2hex(random_bytes($random_bytes_length)); if (!isset($ids[$id])) $ids[$id] = true; } $ids = array_keys($ids); return...
Andreas Hunter
1

votes
0

answer
234

Views

personalized monotonically_increasing_id spark [duplicate]

This question already has an answer here: Concatenate columns in Apache Spark DataFrame 10 answers How to add a constant column in a Spark DataFrame? 3 answers I have several dataframes and I want to uniquely identify each row in each dataframe. Hence I want to use personalized Ids . I am using t...
scalacode
1

votes
1

answer
302

Views

Generate boost::uuids::uuid from boost::compute::detail::sha1

I am trying to generate boost::uuids::uuid from boost::compute::detail::sha1 in this way: #include #include 'boost/uuid/uuid.hpp' #include 'boost/uuid/uuid_io.hpp' #include 'boost/uuid/string_generator.hpp' #include 'boost/compute/detail/sha1.hpp' int main(int argc, char* argv[]) { try { boost::com...
definename
1

votes
1

answer
75

Views

peewee ArrayField of UUIDS

I am trying to manipulate, using peewee, a table which has a column containing an array of uuids. The model is the following: class test_db(BaseModel): arr = playhouse.postgres_ext.ArrayField( peewee.UUIDField, index_type=False ) I would like to insert an entry into this table and I am using the fol...
IceVortex
1

votes
0

answer
26

Views

Use of Solrj with UUIDs

I am trying to use solrj with UUIDs but they are coming back as Strings in the SolrDocument so the reflection fails on the 'getBeans' method. I get following exception. org.apache.solr.client.solrj.beans.BindingException: Could not instantiate at org.apache.solr.client.solrj.beans.DocumentObjectBind...
Pranjal K
1

votes
1

answer
223

Views

Guid to Base64 in Java

I am converting a Guid to Base64 in C# using the following code: var id = Guid.Parse('be9f1bb6-5c8e-407d-85a3-d5ef31f21b4d'); var base64=Convert.ToBase64String(id.ToByteArray()); Output thufvo5cfUCFo9XvMfIbTQ== When I try to do the same in Java using the following: java.util.Base64.Encoder encoder=B...
Yahya Hussein
1

votes
0

answer
227

Views

Symfony - uuid-doctrine - Return the UUID as a string from the query builder

I use the ramsey/uuid-doctrine module to manage UUIDs. I want to get the UUID as a string from the result of a query executed through the query builder. I use the following code: $query = $this->createQueryBuilder('a') ->select('a.id AS id, at.name AS name') ... The id field is the UUID,...
jean553
1

votes
0

answer
43

Views

MySQL Is UUID() is evaluated only once in a statement?

Consider this: select uuid() from my_table; returns different UUIDs: 'fc28ee4e-a147-11e8-93aa-0242ac120002' 'fc28ee7d-a147-11e8-93aa-0242ac120002' 'fc28ee84-a147-11e8-93aa-0242ac120002' 'fc28ee8c-a147-11e8-93aa-0242ac120002' 'fc28ee9b-a147-11e8-93aa-0242ac120002' but select replace (uuid(), '-', '')...
Tim
1

votes
1

answer
158

Views

Mixer.blend() module cannot properly create an instance that is referencing custom User object with UUID as PK

I am trying to run tests of my models using pytest. I am having trouble with using mixer on a SQLite3 in ':memory:' database. I have a model named Category that has a foreign key attribute called 'created_by' which references my custom User model. When assigning the referenced model of User to the...
Ryan Mahaffey
1

votes
0

answer
225

Views

Spring Boot Data Jpa - @ManyToOne Join with UUID id

I am using Spring Boot 2.0.4 with Spring Data Jpa. I have a User model with a user table. User ID is a UUID defined like so: @Id @Type(type='uuid-binary') @GenericGenerator(name='uuid2', strategy='uuid2') @GeneratedValue(generator='uuid2') @Column(columnDefinition='BINARY(16)', unique=true, updatab...
MET
1

votes
1

answer
82

Views

Connect to two Bluetooth Devices with same UUID simultaniusly

i try to create an Android App that connects to two Bluetooth HC-05 Modules (which are connected to an Arduino). I am able to connect to both of them and if i only send Data to one of them everything works fine, if im sending Data to both however it might work for some Time but than it stops sendin...
Hannes
1

votes
1

answer
389

Views

How can I correctly implement UUIDs in Laravel with spatie/laravel-permission and webpatser/laravel-uuid?

I have a Laravel 5.7 application using spatie/laravel-permission and normal IDs for models. I want to transition to using UUIDs and I've taken the steps mentioned in webpatser/laravel-uuid Readme file. Everything works with my own models, e.g. with User, Model A, Model B etc. and the relations seem...
Rareș Popescu
1

votes
0

answer
68

Views

pickle requires uuid.SafeUUID

When reading a pickle-file I have the following problem with open(source_file, 'rb') as fp: data = pickle.load(fp) AttributeError: Can't get attribute 'SafeUUID' on I run Win7Pro with the most minimal Python configuration (Python 3.6.7 and a few libraries that should not have anything to do with th...
user9165100
1

votes
1

answer
45

Views

How to write selenium script for taking random alphanumeric number from a list

I need help in selenium script. I need to take random alphanumeric values from my table list. How I can do it in selenium? I want to use String uniqueID = UUID.randomUUID().toString(); This in my selenium script. But I don't know how to use?
pinki talukdar
1

votes
0

answer
66

Views

Porting libuuid based code from Ubuntu to centOS

I've got piece of code from ubuntu that generate random uuid : #include std::string generateUuid() { uuid_t uuid; uuid_generate(uuid); char uuid_str[37]; uuid_unparse_lower(uuid, uuid_str); std::string res(uuid_str); return res; } I'd like to port this code for centOS, but unfortunately, it's...
1

votes
0

answer
26

Views

SOLR export expression with field of type UUIDField returns java.util.UUID:46d49d49-ac91-49fc-b3c4-79d70e16c744

Export expression with field of type UUIDField (fieldType name='uuid' class='solr.UUIDField' indexed='true') returns in the result set the type of the field and then the value, for example: this query: *search(Schema1,q='uuidFieldName:[* TO *]',fl='uuidFieldName,Time',sort='Time asc',qt='/export')...
Shani
1

votes
1

answer
87

Views

PySpark: Add new column based on a column with UUID in a dataframe

:) I'm working on a huge dataset (dataframe) which I want to show publicly, for which I want to anonymize the data, so instead of having the users' UUID, I want to use like a new column with string like: user1, user2, user3, obviously corresponding to the ID in the other column. I cannot use them w...
Eva
1

votes
1

answer
181

Views

How to insert value into uuid column in Postgres?

I have a table with a uuid column, and some of the rows are missing the data. I need to insert data into this uuid column. The data is entered manually, so we are suffixing with other column data to differentiate, but it gives me an error. UPDATE schema.table SET uuid_column = CONCAT ('f7949f56-884...
knightrider
1

votes
0

answer
26

Views

Non-standard UUID generation (such as using counters)

I find myself often in a situation where I want to generate a very large number of UUIDs rapidly. It would be desirable to generate one UUID 'properly,' then manipulate it to generate the rest. For example, I might just 'add one' to the lowest bits of the UUID. For most of my applications, I contr...
Cort Ammon
1

votes
2

answer
17

Views

Is it okay to use UUID as Surrogate Key for a datawarehouse in hive?

For implementing surrogate keys in our hive data warehouse I have narrowed down to 2 options: 1) reflect('java.util.UUID','randomUUID') 2) INPUT__FILE__NAME + BLOCK__OFFSET__INSIDE__FILE Which of the above to is a better option to go with? Or would you suggest an even better one? Thank you.
Sparrow
1

votes
2

answer
66

Views

How to generate uuid string

Using uuid module I can generate an unique string (such as c389fa3c-3a5c-4d8d-ac92-9b70f2bbe0b5) using: import uuid result = uuid.uuid4() print result which results to: Now, in order to get a generated string I would need to call str() function: uuid_string = str(result) print uuid_string which pri...
alphanumeric
1

votes
1

answer
16

Views

Can't mount /mnt/x after reboot

After rebooting my server, I saw through nagios that my /mnt/gimli was only reachable on read-only mode. But I need it to be writable because some backups go there. To have in in rw mode, I tried unmounting and remounting /mnt/gimli, but got the error : 'mount: can't find UUID=f1953589-1c80-466b-91a...
Ethwall
1

votes
1

answer
853

Views

UUID in OpenOffice.org Base

How would one go about using a UUID as a primary key in an OpenOffice.org Base database? I have a need to gather data on multiple, unnetworked PCs that I can't install software on (I am using OpenOffice.org Portable). After gathering data, it will be merged into a single database. I believe that a U...
Andrew Russell
1

votes
1

answer
1.4k

Views

Generating a uuid for a copied VMWare virtual machine

As per http://www.vmware.com/support/esx15/doc/esx15_runvm5.html, how would one go about generating the UUID format that is specified in the docs? I'd like this to be a command line utility so I can re-use this in an automation script.
tmpvar
1

votes
1

answer
415

Views

Reading Java UUID (from DB) in C#

I'm trying to map a table, where one of the column is a binary array (which is a Java UUID), to a C# class. I would like to read the byte array and return a string representation of the UUID. Just wondering what's a good place to start.
Noel
1

votes
1

answer
1.6k

Views

How to generate boost uuid from string at compile time

is there a way to generate a boost uuid from a string like 988A00C4-79F3-46f9-98CD-D5AD4AA2A0FE at compile time?
Tobias Langner

View additional questions