Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64 ¶
Base64 returns a base64 url encoded, unpadded string of random bytes. len is the length of bytes. It should be the multiple of 3 to get a string without padding: len * 8 / 6. 3 bytes -- 4 chars 6 bytes -- 8 chars 9 bytes -- 12 chars Wechat OAuth code has 32 characters, which is 24 bytes long; Wechat Access Token has 110 chars, which is 82.5 bytes? Wechat Refresh Token has 110 chars. OpenID has 28 chars, which is 21 bytes UnionID has 28 chars.
func IntRange ¶ added in v0.4.7
IntRange returns, as an int, a non-negative pseudo-random number in [min, max). It panics if either of min <= 0 or max <= 0.
func StringWithCharset ¶
StringWithCharset generates a random string from the passed in charset.
Types ¶
This section is empty.