github.com/unidoc/unipdf/v3@v3.55.0/internal/uuid/uuid.go (about) 1 // 2 // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 // 4 // This is a commercial product and requires a license to operate. 5 // A trial license can be obtained at https://unidoc.io 6 // 7 // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 // 9 // Use of this source code is governed by the UniDoc End User License Agreement 10 // terms that can be accessed at https://unidoc.io/eula/ 11 12 package uuid ;import (_b "crypto/rand";_e "encoding/hex";_g "io";);func _ba (_ed []byte ,_ad UUID ){_e .Encode (_ed ,_ad [:4]);_ed [8]='-';_e .Encode (_ed [9:13],_ad [4:6]);_ed [13]='-';_e .Encode (_ed [14:18],_ad [6:8]);_ed [18]='-';_e .Encode (_ed [19:23],_ad [8:10]); 13 _ed [23]='-';_e .Encode (_ed [24:],_ad [10:]);};func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_dd :=_g .ReadFull (_d ,uuid [:]);if _dd !=nil {return _ab ,_dd ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;};var Nil =_ab ; 14 func (_bd UUID )String ()string {var _eb [36]byte ;_ba (_eb [:],_bd );return string (_eb [:])};var _ab UUID ;var _d =_b .Reader ;func MustUUID ()UUID {uuid ,_gb :=NewUUID ();if _gb !=nil {panic (_gb );};return uuid ;};type UUID [16]byte ;