unipdf/internal/uuid/uuid.go
2023-10-07 13:58:01 +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 (_c "crypto/rand";_b "encoding/hex";_dc "io";);func (_ac UUID )String ()string {var _fc [36]byte ;_ca (_fc [:],_ac );return string (_fc [:])};func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_bd :=_dc .ReadFull (_cc ,uuid [:]);if _bd !=nil {return _eg ,_bd ;
};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;};func MustUUID ()UUID {uuid ,_f :=NewUUID ();if _f !=nil {panic (_f );};return uuid ;};var _eg UUID ;func _ca (_dg []byte ,_ed UUID ){_b .Encode (_dg ,_ed [:4]);_dg [8]='-';
_b .Encode (_dg [9:13],_ed [4:6]);_dg [13]='-';_b .Encode (_dg [14:18],_ed [6:8]);_dg [18]='-';_b .Encode (_dg [19:23],_ed [8:10]);_dg [23]='-';_b .Encode (_dg [24:],_ed [10:]);};var _cc =_c .Reader ;type UUID [16]byte ;var Nil =_eg ;