unipdf/internal/uuid/uuid.go
2022-12-15 21:59:56 +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";_e "encoding/hex";_d "io";);func MustUUID ()UUID {uuid ,_dd :=NewUUID ();if _dd !=nil {panic (_dd );};return uuid ;};func (_ec UUID )String ()string {var _g [36]byte ;_ee (_g [:],_ec );return string (_g [:])};var _gf UUID ;
func _ee (_gg []byte ,_bb UUID ){_e .Encode (_gg ,_bb [:4]);_gg [8]='-';_e .Encode (_gg [9:13],_bb [4:6]);_gg [13]='-';_e .Encode (_gg [14:18],_bb [6:8]);_gg [18]='-';_e .Encode (_gg [19:23],_bb [8:10]);_gg [23]='-';_e .Encode (_gg [24:],_bb [10:]);};type UUID [16]byte ;
func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_a :=_d .ReadFull (_ea ,uuid [:]);if _a !=nil {return _gf ,_a ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;};var _ea =_b .Reader ;var Nil =_gf ;