mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-27 13:48:51 +08:00
14 lines
1.1 KiB
Go
14 lines
1.1 KiB
Go
//
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
|
//
|
|
// This is a commercial product and requires a license to operate.
|
|
// A trial license can be obtained at https://unidoc.io
|
|
//
|
|
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
|
//
|
|
// Use of this source code is governed by the UniDoc End User License Agreement
|
|
// terms that can be accessed at https://unidoc.io/eula/
|
|
|
|
package uuid ;import (_b "crypto/rand";_c "encoding/hex";_fc "io";);func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_a :=_fc .ReadFull (_bf ,uuid [:]);if _a !=nil {return _fd ,_a ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;
|
|
};func MustUUID ()UUID {uuid ,_g :=NewUUID ();if _g !=nil {panic (_g );};return uuid ;};var _bf =_b .Reader ;func _ee (_ea []byte ,_cd UUID ){_c .Encode (_ea ,_cd [:4]);_ea [8]='-';_c .Encode (_ea [9:13],_cd [4:6]);_ea [13]='-';_c .Encode (_ea [14:18],_cd [6:8]);
|
|
_ea [18]='-';_c .Encode (_ea [19:23],_cd [8:10]);_ea [23]='-';_c .Encode (_ea [24:],_cd [10:]);};func (_fa UUID )String ()string {var _ad [36]byte ;_ee (_ad [:],_fa );return string (_ad [:])};type UUID [16]byte ;var Nil =_fd ;var _fd UUID ; |