mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-02 22:17:06 +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 (_g "crypto/rand";_ce "encoding/hex";_e "io";);type UUID [16]byte ;var Nil =_fb ;func _ad (_ag []byte ,_f UUID ){_ce .Encode (_ag ,_f [:4]);_ag [8]='-';_ce .Encode (_ag [9:13],_f [4:6]);_ag [13]='-';_ce .Encode (_ag [14:18],_f [6:8]);
|
|
_ag [18]='-';_ce .Encode (_ag [19:23],_f [8:10]);_ag [23]='-';_ce .Encode (_ag [24:],_f [10:]);};func (_da UUID )String ()string {var _dc [36]byte ;_ad (_dc [:],_da );return string (_dc [:])};var _fb UUID ;func MustUUID ()UUID {uuid ,_ed :=NewUUID ();if _ed !=nil {panic (_ed );
|
|
};return uuid ;};func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_ca :=_e .ReadFull (_b ,uuid [:]);if _ca !=nil {return _fb ,_ca ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;};var _b =_g .Reader ; |