guid

What is the difference between a “nonce” and a “GUID”?

拜拜、爱过 提交于 2019-12-04 03:09:16
This question here is about creating an authentication scheme. The accepted answer given by AviD states Your use of a cryptographic nonce is also important, that many tend to skip over - e.g. "lets just use a GUID"... Which leads me to my question. Why wouldn't you just use a GUID? Whenever you randomly generate a random number intended to be used in cryptography, you should be really sure that the number is really random. GUIDs tend to be generated based on values that can be discovered, guessed or inferred, such as current system time or a network card MAC address, and thus the nonce could

REST - get a random number GET or POST?

你。 提交于 2019-12-04 03:05:06
How should a random number generator properly be implemented in REST? GET RANDOM/ or.. POST RANDOM/ The server returns a different random number each time. I can see arguments for both ways. I'd say this is the same as for a page returned that contains the current time - and many of these are done using GET. Abstractly, fetching a random number (or time) the server's state doesn't change - both time and random numbers can be described as an observation of an external event. E.g. http://random.org use atmospheric noise. GET seems most appropriate, although caching will need to be disabled via

how can I use GUID datatype in SQL Server 2008?

穿精又带淫゛_ 提交于 2019-12-04 00:49:53
I want to build an employees table using SQL SERVER 2008 , and in my table I want to have an ID for each employee . I heared about GUID and I kind of understood that its a data type , But I couldn't use it could you please show me the way to use it ... by the way , lets say I want something like this : CREATE TABLE Employees ( ID guid PRIMARY KEY, Name NVARCHAR(50) NOT NULL ) How can I do it ?? because I want to benefit from it , but I couldn't find out how to do that It's not called GUID in SQL Server. It's called uniqueidentifier The type is called UNIQUEIDENTIFIER as others have pointed out

Questions about GUID's: Are they always fixed in length, and is the middle number always 4?

喜欢而已 提交于 2019-12-04 00:40:47
I just generated a few million GUID's turned them into a String and got the length... it was always the same. Can I rely on this fixed length of the GUID when converting to String? Also, is the middle number of the GUID always "4" as shown in this screenshot? Yes, the length is fixed and yes, the middle number is always 4 when you use the standard tostring format. Some of the bits in GUID (known as a UUID almost anywhere that isn't windows) are fixed to indicate things like version etc.. http://en.wikipedia.org/wiki/Uuid EDIT I should add that the "4" only applies to Guids that have been

How to declare a constant Guid in C#?

霸气de小男生 提交于 2019-12-03 23:45:06
问题 Is it possible to declare a constant Guid in C#? I understand that I can declare a static readonly Guid , but is there a syntax that allows me to write const Guid ? 回答1: No. The const modifier only applies to "primitive" types (bool, int, float, double, long, decimal, short, byte) and strings. Basically anything you can declare as a literal. 回答2: Declare it as static readonly Guid rather than const Guid 回答3: public static readonly Guid Users = new Guid("5C60F693-BEF5-E011-A485-80EE7300C695");

Convert GUID to varchar(32)

痴心易碎 提交于 2019-12-03 23:42:58
How can I convert a GUID which is 36 characters to a VARCHAR(32)? I'm trying to copy data from one table to another. There are two similar columns from these two tables. Table1.colx is a GUID so it is 36 characters in length in total due to the hyphens The corresponding column is table2.colx but it is a VARCHAR(32) I am looking for a way to convert a GUID to VARCHAR, but I've got to remove the hyphens. So far I have been unsuccessful in my attempts to find a way to do this. I assume this is SQL Server, from the SSMS tag. Convert the GUID to a string, then replace the hyphens with empty strings

GUID: varchar(36) versus uniqueidentifier

偶尔善良 提交于 2019-12-03 23:19:35
I'm working with a legacy database that stores GUID values as a varchar(36) data type: CREATE TABLE T_Rows ( RowID VARCHAR(36) NOT NULL PRIMARY KEY, RowValue INT NOT NULL ) INSERT T_Rows (RowID, RowValue) VALUES (NEWID(), 1) I would assume that storing a GUID as a uniqueidentifier would be preferable since it's only 16 bytes in size as opposed to 36. Are there any advantages to storing a GUID as a varchar? Perhaps only the fact that you can 'read' them from a SELECT statement (although I don't think that's particularly useful as you can use a function in a select to make Uniqueidentifiers

Generating GUID

烈酒焚心 提交于 2019-12-03 19:23:00
问题 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. 回答1: SQL Server has the creation of

How to generate a GUID in C?

独自空忆成欢 提交于 2019-12-03 18:58:17
I want to generate guids to insert into a SQLite database (i.e. no support from the db itself). However, I would like to have control over certain properties: Orderedness for generating increasing guid values. Computer independence. The db is public and may/may not want guids to allow someone to trace data back to a specific machine. 'Enough' randomness. The guids are keys in the db which is going to be merged with a lot of other dbs and can get quite large, meaning that faking a guid like many algorithms do is no good. I can deal with using system specific APIs but please link both Windows

How to validate GUID is a GUID

廉价感情. 提交于 2019-12-03 18:53:42
问题 How to determine if a string contains a GUID vs just a string of numbers. will a GUID always contain at least 1 alpha character? 回答1: See if these helps :- Guid guidResult = Guid.Parse(inputString) (http://msdn.microsoft.com/en-us/library/system.guid.parse.aspx) bool isValid = Guid.TryParse(inputString, out guidOutput) http://msdn.microsoft.com/en-us/library/system.guid.tryparse.aspx 回答2: There is no guarantee that a GUID contains alpha characters. FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF is a