mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-27 13:48:51 +08:00
14 lines
1.1 KiB
Go
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 (_f "crypto/rand";_g "encoding/hex";_c "io";);func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_dc :=_c .ReadFull (_b ,uuid [:]);if _dc !=nil {return _ca ,_dc ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;
|
|
};var _ca UUID ;var _b =_f .Reader ;func (_ae UUID )String ()string {var _cd [36]byte ;_fe (_cd [:],_ae );return string (_cd [:])};func _fe (_ea []byte ,_bf UUID ){_g .Encode (_ea ,_bf [:4]);_ea [8]='-';_g .Encode (_ea [9:13],_bf [4:6]);_ea [13]='-';_g .Encode (_ea [14:18],_bf [6:8]);
|
|
_ea [18]='-';_g .Encode (_ea [19:23],_bf [8:10]);_ea [23]='-';_g .Encode (_ea [24:],_bf [10:]);};var Nil =_ca ;func MustUUID ()UUID {uuid ,_ad :=NewUUID ();if _ad !=nil {panic (_ad );};return uuid ;};type UUID [16]byte ; |