unipdf/internal/uuid/uuid.go
2022-07-13 21:28:43 +00:00

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";_d "encoding/hex";_a "io";);func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_c :=_a .ReadFull (_be ,uuid [:]);if _c !=nil {return _df ,_c ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;
};type UUID [16]byte ;func (_e UUID )String ()string {var _dg [36]byte ;_ag (_dg [:],_e );return string (_dg [:])};var Nil =_df ;func _ag (_bf []byte ,_bd UUID ){_d .Encode (_bf ,_bd [:4]);_bf [8]='-';_d .Encode (_bf [9:13],_bd [4:6]);_bf [13]='-';_d .Encode (_bf [14:18],_bd [6:8]);
_bf [18]='-';_d .Encode (_bf [19:23],_bd [8:10]);_bf [23]='-';_d .Encode (_bf [24:],_bd [10:]);};var _df UUID ;var _be =_b .Reader ;func MustUUID ()UUID {uuid ,_ae :=NewUUID ();if _ae !=nil {panic (_ae );};return uuid ;};