mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-17 01:44:44 +08:00
1.优化uuid公共模块
2.程序启动错误检测
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
package util
|
||||
package uuid
|
||||
|
||||
import (
|
||||
crand "crypto/rand"
|
||||
@@ -44,6 +44,16 @@ func (this UUID) Hex() string {
|
||||
|
||||
}
|
||||
|
||||
func (this UUID) HexEx() string {
|
||||
x := [16]byte(this)
|
||||
return fmt.Sprintf("%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
x[0], x[1], x[2], x[3], x[4],
|
||||
x[5], x[6],
|
||||
x[7], x[8],
|
||||
x[9], x[10], x[11], x[12], x[13], x[14], x[15])
|
||||
|
||||
}
|
||||
|
||||
// Rand generates a new version 4 UUID.
|
||||
func Rand() UUID {
|
||||
var x [16]byte
|
||||
Reference in New Issue
Block a user