Upgrade dependent version: github.com/open-policy-agent/opa (#5315)
Upgrade dependent version: github.com/open-policy-agent/opa v0.18.0 -> v0.45.0 Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io> Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
22
vendor/github.com/open-policy-agent/opa/internal/uuid/uuid.go
generated
vendored
Normal file
22
vendor/github.com/open-policy-agent/opa/internal/uuid/uuid.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2017 The OPA Authors. All rights reserved.
|
||||
// Use of this source code is governed by an Apache2
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package uuid
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
|
||||
// New Create a version 4 random UUID
|
||||
func New(r io.Reader) (string, error) {
|
||||
bs := make([]byte, 16)
|
||||
n, err := io.ReadFull(r, bs)
|
||||
if n != len(bs) || err != nil {
|
||||
return "", err
|
||||
}
|
||||
bs[8] = bs[8]&^0xc0 | 0x80
|
||||
bs[6] = bs[6]&^0xf0 | 0x40
|
||||
return fmt.Sprintf("%x-%x-%x-%x-%x", bs[0:4], bs[4:6], bs[6:8], bs[8:10], bs[10:]), nil
|
||||
}
|
||||
Reference in New Issue
Block a user