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";_a "encoding/hex";_fd "io";);var Nil =_cbc ;var _cbc UUID ;func (_d UUID )String ()string {var _cg [36]byte ;_e (_cg [:],_d );return string (_cg [:])};var _ae =_f .Reader ;func NewUUID ()(UUID ,error ){var uuid UUID ;
|
|
_ ,_cd :=_fd .ReadFull (_ae ,uuid [:]);if _cd !=nil {return _cbc ,_cd ;};uuid [6]=(uuid [6]&0x0f)|0x40;uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;};func MustUUID ()UUID {uuid ,_cb :=NewUUID ();if _cb !=nil {panic (_cb );};return uuid ;};func _e (_ec []byte ,_cf UUID ){_a .Encode (_ec ,_cf [:4]);
|
|
_ec [8]='-';_a .Encode (_ec [9:13],_cf [4:6]);_ec [13]='-';_a .Encode (_ec [14:18],_cf [6:8]);_ec [18]='-';_a .Encode (_ec [19:23],_cf [8:10]);_ec [23]='-';_a .Encode (_ec [24:],_cf [10:]);};type UUID [16]byte ; |