guid

Is using a GUID security though obscurity?

北慕城南 提交于 2019-11-30 17:27:14
If you use a GUID as a password for a publicly facing application as a means to gain access to a service, is this security through obscurity? I think the obvious answer is yes, but the level of security seems very high to me since the chances of guessing a GUID is very very low correct? Update The GUID will be stored in a device, when plugged in, will send over the GUID via SSL connection. Maybe I could generate a GUID, then do a AES 128 bit encrption on the GUID and store that value on the device? In my opinion, the answer is no. If you set a password to be a newly created GUID, then it is a

Allow null foreign key GUID

拜拜、爱过 提交于 2019-11-30 17:01:50
问题 I want to create a nullable foreign key with type GUID like this [ForeignKey("CreatedBy")] [Display(Name = "Created by")] public Guid? CreatedById { get; set; } public virtual User CreatedBy { get; set; } But when I add migration and update the database it doesn't make it allow null in table design in SQL. Is there another way to make it allow null through model first ? 回答1: Not sure why yours doesn't work or if you figured it out. We have pretty much the same design and we get nullable

How to generate random unique 16 digit number in asp.net without collision

大兔子大兔子 提交于 2019-11-30 15:39:27
how can i generate 16 digit unique random numbers without any repetition in c# asp.net, as i have read the concept of GUID which generate characters along with numbers but i don't want characters kindly suggest is there any way to acheive it You can create a random number using the Random class: private static Random RNG = new Random(); public string Create16DigitString() { var builder = new StringBuilder(); while (builder.Length < 16) { builder.Append(RNG.Next(10).ToString()); } return builder.ToString(); } Ensuring that there are no collisions requires you to track all results that you have

Guid Uniqueness On different machine [duplicate]

谁都会走 提交于 2019-11-30 15:06:57
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Is a GUID unique 100% of the time? After reading all posts on Guid, still I am unclear about one simple thing: Guids generated by different machines also maintain their Uniqueness or not. I have read about guid uniqueness on single machine,but I still don't know about uniqueness with different machines 回答1: GUID are "practically" universally unique. A GUID is a 128-bit integer (16 bytes) that can be used across

Guid Uniqueness On different machine [duplicate]

空扰寡人 提交于 2019-11-30 12:57:01
Possible Duplicate: Is a GUID unique 100% of the time? After reading all posts on Guid, still I am unclear about one simple thing: Guids generated by different machines also maintain their Uniqueness or not. I have read about guid uniqueness on single machine,but I still don't know about uniqueness with different machines Tilak GUID are "practically" universally unique. A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated. From the MSDN It is

Generating GUID

偶尔善良 提交于 2019-11-30 08:35:42
I am thinking to use a GUID in my .net app which uses SQL Server. Should I be writing a stored procedure which generates the GUID on each record entered or should I be directly generating it from the application. Reasons for asking the question (If am wrong correct me in this): I (as/pre)sume: When generating the GUID from the database, you can assume that the DB remembers the previous generated GUID where as the application remembering it is difficult. SQL Server has the creation of GUID's built in. There is no need to write a separate stored procedure for this. You can use NEWID()

default value of GUID in for a column in mysql

此生再无相见时 提交于 2019-11-30 08:16:39
问题 I want a column to default to a GUID, so if I am doing an insert and I don't explicitly set the value, I want it to default to a new GUID value. how can I do this? 回答1: Being that UUID() isn't accepted as a DEFAULT constraint, you need to use a trigger. This one sets the value for the NEW_TABLE.uuid column: delimiter $$ CREATE DEFINER=`root`@`localhost` TRIGGER `example`.`newid` BEFORE INSERT ON `example`.`new_table` FOR EACH ROW BEGIN SET NEW.`uuid` = UUID(); END $$ 回答2: Previous answer is

Performance value of COMB guids

旧时模样 提交于 2019-11-30 08:08:57
问题 Jimmy Nilsson discusses his COMB guid concept here. This concept is popular in NHibernate, among other circles, for its supposed performance value over standard GUIDs which are typically far more random. However, in testing, this does not appear to be the case. Am I missing something? Test case: I have a table called temp (not a temp table, just a table named "temp") with 585,000 rows in it. I have a new table called Codes, and wish to copy all 585,000 code values from the temp table to the

Create a cryptographically secure random GUID in .NET

浪尽此生 提交于 2019-11-30 08:06:41
I want to create a cryptographically secure GUID (v4) in .NET. .NET's Guid.NewGuid() function is not cryptographically secure, but .NET does provide the System.Security.Cryptography.RNGCryptoServiceProvider class. I would like to be able to pass a random number function as a delegate to Guid.NewGuid (or even pass some class that provides a generator interface) but it doesn't look as though that is possible with the default implementation. Can I create a cryptographically secure GUID by using System.GUID and System.Security.Cryptography.RNGCryptoServiceProvider together? Yes you can, Guid

Command line GUID for Unix and Windows?

江枫思渺然 提交于 2019-11-30 08:02:30
Is there a command line tool for Unix and Windows that uses the same algorithm to create GUIDs for both platforms? 'e2fsprogs' project maintain uuidgen utility. http://e2fsprogs.sourceforge.net/ It is already available on any Linux/BSD* distros. For Windows I recommend install Cygwin, 'e2fsprogs' package available from there! As report j4y this utility is available under MAC OS. Just run: $ uuidgen -r # random based UUID/GUID $ uuidgen -t # time based UUID/GUID I don't know if there is a command line tool available, but you could simply write one in C# (it should run with Mono): class Program