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-07-28 12:14:31 +00:00
package uuid ;import (_a "crypto/rand";_g "encoding/hex";_c "io";);func _dc (_bb []byte ,_ec UUID ){_g .Encode (_bb ,_ec [:4]);_bb [8]='-';_g .Encode (_bb [9:13],_ec [4:6]);_bb [13]='-';_g .Encode (_bb [14:18],_ec [6:8]);_bb [18]='-';_g .Encode (_bb [19:23],_ec [8:10]);
_bb [23]='-';_g .Encode (_bb [24:],_ec [10:]);};var Nil =_de ;var _ef =_a .Reader ;func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_ga :=_c .ReadFull (_ef ,uuid [:]);if _ga !=nil {return _de ,_ga ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;
return uuid ,nil ;};type UUID [16]byte ;func (_bg UUID )String ()string {var _f [36]byte ;_dc (_f [:],_bg );return string (_f [:])};var _de UUID ;func MustUUID ()UUID {uuid ,_be :=NewUUID ();if _be !=nil {panic (_be );};return uuid ;};