table.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // generated by go run gen.go; DO NOT EDIT
  2. package publicsuffix
  3. import _ "embed"
  4. const version = "publicsuffix.org's public_suffix_list.dat, git revision 63cbc63d470d7b52c35266aa96c4c98c96ec499c (2023-08-03T10:01:25Z)"
  5. const (
  6. nodesBits = 40
  7. nodesBitsChildren = 10
  8. nodesBitsICANN = 1
  9. nodesBitsTextOffset = 16
  10. nodesBitsTextLength = 6
  11. childrenBitsWildcard = 1
  12. childrenBitsNodeType = 2
  13. childrenBitsHi = 14
  14. childrenBitsLo = 14
  15. )
  16. const (
  17. nodeTypeNormal = 0
  18. nodeTypeException = 1
  19. nodeTypeParentOnly = 2
  20. )
  21. // numTLD is the number of top level domains.
  22. const numTLD = 1474
  23. // text is the combined text of all labels.
  24. //
  25. //go:embed data/text
  26. var text string
  27. // nodes is the list of nodes. Each node is represented as a 40-bit integer,
  28. // which encodes the node's children, wildcard bit and node type (as an index
  29. // into the children array), ICANN bit and text.
  30. //
  31. // The layout within the node, from MSB to LSB, is:
  32. //
  33. // [ 7 bits] unused
  34. // [10 bits] children index
  35. // [ 1 bits] ICANN bit
  36. // [16 bits] text index
  37. // [ 6 bits] text length
  38. //
  39. //go:embed data/nodes
  40. var nodes uint40String
  41. // children is the list of nodes' children, the parent's wildcard bit and the
  42. // parent's node type. If a node has no children then their children index
  43. // will be in the range [0, 6), depending on the wildcard bit and node type.
  44. //
  45. // The layout within the uint32, from MSB to LSB, is:
  46. //
  47. // [ 1 bits] unused
  48. // [ 1 bits] wildcard bit
  49. // [ 2 bits] node type
  50. // [14 bits] high nodes index (exclusive) of children
  51. // [14 bits] low nodes index (inclusive) of children
  52. //
  53. //go:embed data/children
  54. var children uint32String
  55. // max children 743 (capacity 1023)
  56. // max text offset 30876 (capacity 65535)
  57. // max text length 31 (capacity 63)
  58. // max hi 9322 (capacity 16383)
  59. // max lo 9317 (capacity 16383)