mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 07:52:25 -05:00 
			
		
		
		
	[chore]: Bump github.com/google/uuid from 1.5.0 to 1.6.0 (#2604)
This commit is contained in:
		
					parent
					
						
							
								a482cb59f2
							
						
					
				
			
			
				commit
				
					
						d59cba487f
					
				
			
		
					 6 changed files with 57 additions and 9 deletions
				
			
		
							
								
								
									
										13
									
								
								vendor/github.com/google/uuid/CHANGELOG.md
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/github.com/google/uuid/CHANGELOG.md
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -1,5 +1,18 @@ | |||
| # Changelog | ||||
| 
 | ||||
| ## [1.6.0](https://github.com/google/uuid/compare/v1.5.0...v1.6.0) (2024-01-16) | ||||
| 
 | ||||
| 
 | ||||
| ### Features | ||||
| 
 | ||||
| * add Max UUID constant ([#149](https://github.com/google/uuid/issues/149)) ([c58770e](https://github.com/google/uuid/commit/c58770eb495f55fe2ced6284f93c5158a62e53e3)) | ||||
| 
 | ||||
| 
 | ||||
| ### Bug Fixes | ||||
| 
 | ||||
| * fix typo in version 7 uuid documentation ([#153](https://github.com/google/uuid/issues/153)) ([016b199](https://github.com/google/uuid/commit/016b199544692f745ffc8867b914129ecb47ef06)) | ||||
| * Monotonicity in UUIDv7 ([#150](https://github.com/google/uuid/issues/150)) ([a2b2b32](https://github.com/google/uuid/commit/a2b2b32373ff0b1a312b7fdf6d38a977099698a6)) | ||||
| 
 | ||||
| ## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12) | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										6
									
								
								vendor/github.com/google/uuid/hash.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/github.com/google/uuid/hash.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -17,6 +17,12 @@ var ( | |||
| 	NameSpaceOID  = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8")) | ||||
| 	NameSpaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8")) | ||||
| 	Nil           UUID // empty UUID, all zeros | ||||
| 
 | ||||
| 	// The Max UUID is special form of UUID that is specified to have all 128 bits set to 1. | ||||
| 	Max = UUID{ | ||||
| 		0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||||
| 		0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||||
| 	} | ||||
| ) | ||||
| 
 | ||||
| // NewHash returns a new UUID derived from the hash of space concatenated with | ||||
|  |  | |||
							
								
								
									
										39
									
								
								vendor/github.com/google/uuid/version7.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										39
									
								
								vendor/github.com/google/uuid/version7.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -44,7 +44,7 @@ func NewV7FromReader(r io.Reader) (UUID, error) { | |||
| 
 | ||||
| // makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6]) | ||||
| // uuid[8] already has the right version number (Variant is 10) | ||||
| // see function  NewV7 and NewV7FromReader | ||||
| // see function NewV7 and NewV7FromReader | ||||
| func makeV7(uuid []byte) { | ||||
| 	/* | ||||
| 		 0                   1                   2                   3 | ||||
|  | @ -52,7 +52,7 @@ func makeV7(uuid []byte) { | |||
| 		+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| 		|                           unix_ts_ms                          | | ||||
| 		+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| 		|          unix_ts_ms           |  ver  |       rand_a          | | ||||
| 		|          unix_ts_ms           |  ver  |  rand_a (12 bit seq)  | | ||||
| 		+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
| 		|var|                        rand_b                             | | ||||
| 		+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||||
|  | @ -61,7 +61,7 @@ func makeV7(uuid []byte) { | |||
| 	*/ | ||||
| 	_ = uuid[15] // bounds check | ||||
| 
 | ||||
| 	t := timeNow().UnixMilli() | ||||
| 	t, s := getV7Time() | ||||
| 
 | ||||
| 	uuid[0] = byte(t >> 40) | ||||
| 	uuid[1] = byte(t >> 32) | ||||
|  | @ -70,6 +70,35 @@ func makeV7(uuid []byte) { | |||
| 	uuid[4] = byte(t >> 8) | ||||
| 	uuid[5] = byte(t) | ||||
| 
 | ||||
| 	uuid[6] = 0x70 | (uuid[6] & 0x0F) | ||||
| 	// uuid[8] has already has right version | ||||
| 	uuid[6] = 0x70 | (0x0F & byte(s>>8)) | ||||
| 	uuid[7] = byte(s) | ||||
| } | ||||
| 
 | ||||
| // lastV7time is the last time we returned stored as: | ||||
| // | ||||
| //	52 bits of time in milliseconds since epoch | ||||
| //	12 bits of (fractional nanoseconds) >> 8 | ||||
| var lastV7time int64 | ||||
| 
 | ||||
| const nanoPerMilli = 1000000 | ||||
| 
 | ||||
| // getV7Time returns the time in milliseconds and nanoseconds / 256. | ||||
| // The returned (milli << 12 + seq) is guarenteed to be greater than | ||||
| // (milli << 12 + seq) returned by any previous call to getV7Time. | ||||
| func getV7Time() (milli, seq int64) { | ||||
| 	timeMu.Lock() | ||||
| 	defer timeMu.Unlock() | ||||
| 
 | ||||
| 	nano := timeNow().UnixNano() | ||||
| 	milli = nano / nanoPerMilli | ||||
| 	// Sequence number is between 0 and 3906 (nanoPerMilli>>8) | ||||
| 	seq = (nano - milli*nanoPerMilli) >> 8 | ||||
| 	now := milli<<12 + seq | ||||
| 	if now <= lastV7time { | ||||
| 		now = lastV7time + 1 | ||||
| 		milli = now >> 12 | ||||
| 		seq = now & 0xfff | ||||
| 	} | ||||
| 	lastV7time = now | ||||
| 	return milli, seq | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue