2018-07-23 11:12:14 +08:00
|
|
|
package bencode
|
|
|
|
|
|
|
|
import (
|
|
|
|
"reflect"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Wow Go is retarded.
|
2021-09-18 10:43:53 +08:00
|
|
|
var (
|
|
|
|
marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
|
|
|
|
unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
|
|
|
|
)
|
2018-07-23 11:12:14 +08:00
|
|
|
|
|
|
|
func bytesAsString(b []byte) string {
|
2021-09-14 08:41:04 +08:00
|
|
|
return *(*string)(unsafe.Pointer(&b))
|
2018-07-23 11:12:14 +08:00
|
|
|
}
|