aboutsummaryrefslogtreecommitdiff
path: root/unipdf/internal/uuid/uuid.go
blob: e7e96df3b27c61438d731a6105e28bfc69e5fd3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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 ;