mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 13:50:01 +00:00 
			
		
		
		
	First commit
This commit is contained in:
		
							
								
								
									
										20
									
								
								third_party/github.com/fsouza/go-dockerclient/utils/random.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								third_party/github.com/fsouza/go-dockerclient/utils/random.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| // Copyright 2014 Docker authors. All rights reserved. | ||||
| // Use of this source code is governed by a BSD-style | ||||
| // license that can be found in the DOCKER-LICENSE file. | ||||
|  | ||||
| package utils | ||||
|  | ||||
| import ( | ||||
| 	"crypto/rand" | ||||
| 	"encoding/hex" | ||||
| 	"io" | ||||
| ) | ||||
|  | ||||
| func RandomString() string { | ||||
| 	id := make([]byte, 32) | ||||
| 	_, err := io.ReadFull(rand.Reader, id) | ||||
| 	if err != nil { | ||||
| 		panic(err) // This shouldn't happen | ||||
| 	} | ||||
| 	return hex.EncodeToString(id) | ||||
| } | ||||
		Reference in New Issue
	
	Block a user