mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-04 13:32:52 -04:00
24 lines
349 B
Go
24 lines
349 B
Go
package common
|
|
|
|
import (
|
|
"github.com/bounce-chat/go-i2p/lib/tunnel"
|
|
)
|
|
|
|
type Lease [44]byte
|
|
|
|
func (lease Lease) TunnelGateway() (h Hash) {
|
|
copy(lease[:32], h[:])
|
|
return
|
|
}
|
|
|
|
func (lease Lease) TunnelID() tunnel.TunnelID {
|
|
return tunnel.TunnelID(
|
|
Integer(lease[32:36]),
|
|
)
|
|
}
|
|
|
|
func (lease Lease) Date() (d Date) {
|
|
copy(lease[36:], d[:])
|
|
return
|
|
}
|