diff options
Diffstat (limited to 'unipdf/internal/uuid/uuid.go')
| -rw-r--r-- | unipdf/internal/uuid/uuid.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/unipdf/internal/uuid/uuid.go b/unipdf/internal/uuid/uuid.go new file mode 100644 index 0000000..e7e96df --- /dev/null +++ b/unipdf/internal/uuid/uuid.go @@ -0,0 +1,14 @@ +// +// 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 (_d "crypto/rand";_gg "encoding/hex";_g "io";);func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_f :=_g .ReadFull (_e ,uuid [:]);if _f !=nil {return _gf ,_f ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ; +};func MustUUID ()UUID {uuid ,_ec :=NewUUID ();if _ec !=nil {panic (_ec );};return uuid ;};var _gf UUID ;type UUID [16]byte ;var Nil =_gf ;func _b (_ea []byte ,_eg UUID ){_gg .Encode (_ea ,_eg [:4]);_ea [8]='-';_gg .Encode (_ea [9:13],_eg [4:6]);_ea [13]='-'; +_gg .Encode (_ea [14:18],_eg [6:8]);_ea [18]='-';_gg .Encode (_ea [19:23],_eg [8:10]);_ea [23]='-';_gg .Encode (_ea [24:],_eg [10:]);};func (_cfc UUID )String ()string {var _cff [36]byte ;_b (_cff [:],_cfc );return string (_cff [:])};var _e =_d .Reader ; |
