unipdf/internal/uuid/uuid.go

14 lines
1.1 KiB
Go
Raw Normal View History

2021-08-13 01:33:42 +00:00
//
// 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/
2023-06-30 13:19:48 +00:00
package uuid ;import (_a "crypto/rand";_c "encoding/hex";_b "io";);func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_da :=_b .ReadFull (_g ,uuid [:]);if _da !=nil {return _ag ,_da ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;
};var _ag UUID ;type UUID [16]byte ;var _g =_a .Reader ;func _ba (_ac []byte ,_ed UUID ){_c .Encode (_ac ,_ed [:4]);_ac [8]='-';_c .Encode (_ac [9:13],_ed [4:6]);_ac [13]='-';_c .Encode (_ac [14:18],_ed [6:8]);_ac [18]='-';_c .Encode (_ac [19:23],_ed [8:10]);
_ac [23]='-';_c .Encode (_ac [24:],_ed [10:]);};var Nil =_ag ;func (_f UUID )String ()string {var _dde [36]byte ;_ba (_dde [:],_f );return string (_dde [:])};func MustUUID ()UUID {uuid ,_ef :=NewUUID ();if _ef !=nil {panic (_ef );};return uuid ;};