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-05-29 17:26:33 +00:00
package uuid ;import (_f "crypto/rand";_b "encoding/hex";_e "io";);var _a =_f .Reader ;func MustUUID ()UUID {uuid ,_fd :=NewUUID ();if _fd !=nil {panic (_fd );};return uuid ;};func (_ab UUID )String ()string {var _ef [36]byte ;_aaf (_ef [:],_ab );return string (_ef [:])};
func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_aa :=_e .ReadFull (_a ,uuid [:]);if _aa !=nil {return _da ,_aa ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;};func _aaf (_ac []byte ,_ae UUID ){_b .Encode (_ac ,_ae [:4]);
_ac [8]='-';_b .Encode (_ac [9:13],_ae [4:6]);_ac [13]='-';_b .Encode (_ac [14:18],_ae [6:8]);_ac [18]='-';_b .Encode (_ac [19:23],_ae [8:10]);_ac [23]='-';_b .Encode (_ac [24:],_ae [10:]);};var Nil =_da ;var _da UUID ;type UUID [16]byte ;