feat(ebooks): Add tvl-ebooks code

Change-Id: If519e789a91fbf427373daa383c6ae00ba5e0b6c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2007
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Ben Cartwright-Cox 2020-09-28 00:22:05 +01:00 committed by ben
parent cf878224ab
commit a8508373ee
8 changed files with 687 additions and 0 deletions

View file

@ -0,0 +1,26 @@
package main
import (
"crypto/rand"
"log"
"net"
)
func main() {
// 2a0c:2f07:29:9999:6564:5298:8413:4652
ip := net.ParseIP("2a0c:2f07:29::")
rand.Read(ip[6:])
if ip[7] > 0xaa {
ip[4] = 0x03
ip[5] = 0x84
if ip[7] > 0xdd {
ip[4] = 0x08
ip[5] = 0x64
}
}
log.Printf("%s\n", ip)
//
}