unipdf/internal/uuid/uuid.go
2021-10-22 10:53:20 +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";_e "io";);func MustUUID ()UUID {uuid ,_de :=NewUUID ();if _de !=nil {panic (_de );};return uuid ;};var _c =_b .Reader ;var Nil =_aed ;var _aed UUID ;type UUID [16]byte ;func _dc (_ab []byte ,_dg UUID ){_d .Encode (_ab ,_dg [:4]);
_ab [8]='-';_d .Encode (_ab [9:13],_dg [4:6]);_ab [13]='-';_d .Encode (_ab [14:18],_dg [6:8]);_ab [18]='-';_d .Encode (_ab [19:23],_dg [8:10]);_ab [23]='-';_d .Encode (_ab [24:],_dg [10:]);};func (_g UUID )String ()string {var _ae [36]byte ;_dc (_ae [:],_g );
return string (_ae [:])};func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_ea :=_e .ReadFull (_c ,uuid [:]);if _ea !=nil {return _aed ,_ea ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;};