uuid

Is using a CreateUUID() function as salt a good idea?

点点圈 提交于 2019-12-08 16:29:37
问题 I'm using coldfusion and I would like to generate a random salt field for my passwords. I was wondering if a CreateUUID() function is useful here. I found many examples which use a seperate function to create the salt string; but why do this when you could use rand() or CreateUUID() functions instead? I'm not sure. Is it an overkill or a good idea? Or should I use rand() or a timestamp instead? 回答1: This is not a good idea - CreateUUID guarantees uniqueness , not randomness ; if you did a

Postgres + Hibernate + Java UUID

孤者浪人 提交于 2019-12-08 16:25:51
问题 I want to use PostgreSQL's native UUID type with a Java UUID. I am using Hibernate as my JPA provider and ORM. If I try to save it directly, it is just saved as a bytea in Postgres. How can I do this? 回答1: Try use the latest development version of the JDBC driver (Currently 8.4dev-700), or wait for the next release version. (Edited to add: 8.4-701 has been released) The release notes mention this change: Map the database uuid type to java.util.UUID. This only works for relatively new server

Where can I find a php lib for generating time-based (v1) UUID?

扶醉桌前 提交于 2019-12-08 12:37:09
问题 Where can I find a php lib for generating time-based (v1) UUID? Thanks in advance! 回答1: I assume you want something like this: http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/ https://github.com/fredriklindberg/class.uuid.php E.g.: require_once('class.uuid.php'); $str = UUID::generate(UUID::UUID_TIME, UUID::FMT_STRING, "abcdef"); echo $str; // Output: 1b55e723-578b-4e34-d5cf-616263646566 回答2: For a native RFC compliant implementation, see http://jkingweb.ca/code/php/lib.uuid/

SQLServer-uuid

我的未来我决定 提交于 2019-12-08 11:57:52
select cast(NEWID() as varchar(36)) as uuid ; --AC12EEDA-4FBD-49FD-B0A9-67E17726F3E4 select Replace(s.uuid,'-','') from (select cast(NEWID() as varchar(36)) as uuid ) s ; --A4C260D6C84D40D3899434EF41E09C65 来源: CSDN 作者: vv_wisher 链接: https://blog.csdn.net/vv_wisher/article/details/89509635

How to create UUID type 1 in objective C (iOS)

爷,独闯天下 提交于 2019-12-08 09:27:23
问题 I created UUID (don't know which type) with the following code: // Create universally unique identifier (object) CFUUIDRef uuidObject = CFUUIDCreate(kCFAllocatorDefault); // Get the string representation of CFUUID object. NSString *uuidStr = (__bridge NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuidObject); CFRelease(uuidObject); But my API that is send data to says that is not type 1 that it needs http://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_.28MAC_address.29.

TimeUUID with Cassandra and Lazyboy

不问归期 提交于 2019-12-08 08:55:45
问题 I try to insert column with UUID1 keys to be able to sort them by date. I always get the error "cassandra.ttypes.InvalidRequestException: InvalidRequestException(why='UUIDs must be exactly 16 bytes')", and I don't know why. Here is the code generating this error : from lazyboy import * from lazyboy.key import Key import uuid class TestItemKey(Key): def __init__(self, key=None): Key.__init__(self, 'MXstore', 'TestCF', key) class TestItem(record.Record): def __init__(self, *args, **kwargs):

Returning Hex UUID as default value for Django model charfield

纵然是瞬间 提交于 2019-12-08 05:28:13
问题 I tried to create a model with identifier generated from uuid4. But what I want instead of regular uuid, I want identifier has hex uuid format (without "-"). Here is what I tried: class Model(models.Model): identifier = models.CharField(max_length=32, primary_key=True, default=uuid.uuid4().hex, editable=False) created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) def __str__(self): return self.identifier class Meta: abstract = True instead of

Is it safe to assume boost::uuid won't return a duplicate?

穿精又带淫゛_ 提交于 2019-12-08 01:55:12
问题 I'm using boost uuid to generate session ids. std::string SessionGenerator::generate() { boost::uuids::uuid id = m_rgen(); m_ss.clear(); m_ss.str(""); m_ss << id; return m_ss.str(); } Is it safe to assume that I'm never going to get a duplicate or should I be doing checks against active sessions? Thanks 回答1: Well, it depends. When UUIDs are generated by one of the defined mechanisms, they are either guaranteed to be unique , different from all other generated UUIDs (that is, it has never been

Rest API and UUID

[亡魂溺海] 提交于 2019-12-08 01:54:55
问题 One of the reasons, and probably the main one, to use UUID is to avoid having a "centralized" point responsible for creating and assigning ids to resources. That means that, for REST APIs, the clients could (and should) be able to generate, and give the UUID for a certain resource when they POST that specific resource for the first time. That would minimize problems related with successfully posting a resource for the first time but not getting the ID back as response (connectivity problems

why use apps for generating custom uuid instead database id?

半城伤御伤魂 提交于 2019-12-08 01:30:20
问题 why should I use an app to generate UUID instead using database id's? is there an advantage? I see many apps that generates UUID preventing colision. so than is this possible to happen in database id like mysql or mongodb? 回答1: One theoretical reason for using random UUIDs instead of relying on database IDs is the ability to do parallel inserts of new records without locking and incrementing a counter, or even looking up a unique index. If you have an auto-increment field, something needs to