Documentation ¶
Index ¶
Constants ¶
const MaxBase37 = 6582952005840035281
MaxBase37 Max base37 string hash for 12-rune usernames. (999999999999)
Variables ¶
var Base16 struct { //Int returns an integer representation of the provided base-16 string Int func(string) uint64 //String returns the base-16 string representation of the provided hexidecimal integer String func(uint64) string }
var Base2 struct { //Int returns an integer representation of the provided base-2 string Int func(string) uint64 //String returns the base-2 string representation of the provided hexidecimal integer String func(uint64) string }
var Base37 struct { //Encode Encodes a string into its base 37 integer hash and returns the hash. Input will be filtered appropriately. Encode func(string) uint64 //Decode Decodes a string from its base 37 integer hash form back into a Go string and returns it, placing capital letters where appropriate. Decode func(uint64) string }
Base37 Represents a single API access point for encoding strings to their base 37 integer hash and converting base 37 hashes back to strings.
var BaseConversion struct { //Int returns an integer representation of the provided string using the provided base. Int func(int, string) uint64 //String returns a string encoding of the provided integer using the provided base. String func(int, uint64) string }
var ChatFilter struct { //Pack Takes a string as input, and returns a packed bitstream as output. It can fit any of the first 13 runes in the alphabet into 4 bits per rune, but for the rest of the alphabet it's 8 bits. Pack func(string) []byte //Unpack Takes a byte slice as input, and decodes it into a human readable chat message. // Works by unpacking the bits into 2 4-bit values. 86% of the time, this is enough information for the output rune. // 14% of the time, it will cache this value and use the next 4 bits to help decode the rune. // The first 13 runes in the charset map 1 to 1 for 13/15 possibilities within each 4 bits. Unpack func([]byte) string //Format Format a given string for use with the in-game chat systems. // Will replace certain symbols and auto-capitalize sentences. Maybe more later. Format func(string) string }
ChatFilter Represents a single API access point for encoding and decoding chat messages using
Functions ¶
func CombatPrefix ¶
CombatPrefix Returns the chat prefix to colorize combat levels in right click menus and such. The color fades red as the target compares better than you, or fades green as the target compares worse than you. White indicates an equal target.
func IPToHexidecimal ¶
func IPToInteger ¶
IPToInteger Converts a string representation of an IPv4 address(e.g 127.0.0.1) to a 4-byte integer, each byte containing the information from one octet.
Types ¶
This section is empty.