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 (_g "crypto/rand";_ge "encoding/hex";_aa "io";);type UUID [16]byte ;var _af UUID ;var Nil =_af ;func NewUUID ()(UUID ,error ){var uuid UUID ;_ ,_agg :=_aa .ReadFull (_f ,uuid [:]);if _agg !=nil {return _af ,_agg ;};uuid [6]=(uuid [6]&0x0f)|0x40;
|
|
uuid [8]=(uuid [8]&0x3f)|0x80;return uuid ,nil ;};func MustUUID ()UUID {uuid ,_fa :=NewUUID ();if _fa !=nil {panic (_fa );};return uuid ;};func _ec (_ece []byte ,_ed UUID ){_ge .Encode (_ece ,_ed [:4]);_ece [8]='-';_ge .Encode (_ece [9:13],_ed [4:6]);_ece [13]='-';
|
|
_ge .Encode (_ece [14:18],_ed [6:8]);_ece [18]='-';_ge .Encode (_ece [19:23],_ed [8:10]);_ece [23]='-';_ge .Encode (_ece [24:],_ed [10:]);};var _f =_g .Reader ;func (_d UUID )String ()string {var _e [36]byte ;_ec (_e [:],_d );return string (_e [:])}; |